Xml &引用;NSL“;XSL文件中的含义

Xml &引用;NSL“;XSL文件中的含义,xml,xslt,soa,Xml,Xslt,Soa,我是XSL文件的新手,在理解下面的代码时遇到了一些问题。我在互联网上搜索过,找不到任何东西可以告诉我“nsl”的确切含义。 有人能帮我解释一下吗? 这是SOA系统的一部分 <xsl:when test='ns1:Payment/ns1:PaymentHeader/ns1:ConsolidationType = "STANDARD"'> <xsl:for-each select="ns1:Payment/ns

我是XSL文件的新手,在理解下面的代码时遇到了一些问题。我在互联网上搜索过,找不到任何东西可以告诉我“nsl”的确切含义。 有人能帮我解释一下吗? 这是SOA系统的一部分

                <xsl:when test='ns1:Payment/ns1:PaymentHeader/ns1:ConsolidationType = "STANDARD"'>
                    <xsl:for-each select="ns1:Payment/ns1:PaymentModeDetail/ns1:GenericDetail/ns1:GenericLineItem">
                       <ns0:ApInvoiceLinesInterface>
                          <ns0:invoiceLineId>
                             <xsl:value-of select="oraext:sequence-next-val('AP_INVOICE_LINES_INTERFACE_S',$CONN)"/>
                          </ns0:invoiceLineId>
                          <xsl:choose>
                             <xsl:when test="ns1:CommonInvoiceLineElements/ns1:AdjustmentReasonGid/ns1:Gid/ns1:Xid!=''">                                 
                                <ns0:lineTypeLookupCode>
                                   <xsl:text disable-output-escaping="no">MISCELLANEOUS</xsl:text>
                                </ns0:lineTypeLookupCode>
                             </xsl:when>
                             <xsl:otherwise>
                                <ns0:lineTypeLookupCode>
                                   <xsl:text disable-output-escaping="no">FREIGHT</xsl:text>
                                </ns0:lineTypeLookupCode>
                             </xsl:otherwise>
                          </xsl:choose>
                          <ns0:amount>
                             <xsl:value-of select="ns1:CommonInvoiceLineElements/ns1:FreightRate/ns1:FreightCharge/ns1:FinancialAmount/ns1:MonetaryAmount"/>
                          </ns0:amount>
                          <ns0:description>
                             <xsl:value-of select='concat(substring-after(../../../ns1:PaymentHeader/ns1:InvoiceRefnum[ns1:InvoiceRefnumQualifierGid/ns1:Gid/ns1:Xid="INVOICE_DESCRIPTION"]/ns1:InvoiceRefnumValue,"BNM."),ns1:CostTypeGid/ns1:Gid/ns1:Xid)'/>
                          </ns0:description>
                          <ns0:taxClassificationCode>
                             <xsl:value-of select='concat(../../../ns1:PaymentHeader/ns1:VatAnalysis/ns1:VatCodeGid/ns1:Gid/ns1:Xid,"%")'/>
                          </ns0:taxClassificationCode>
                          <ns0:distCodeConcatenated>
                             <xsl:value-of select="ns1:CommonInvoiceLineElements/ns1:GeneralLedgerGid/ns1:Gid/ns1:Xid"/>
                          </ns0:distCodeConcatenated>
                       </ns0:ApInvoiceLinesInterface>
                    </xsl:for-each>
                 </xsl:when>

混杂的
运费
我最想了解的是:

<ns0:amount>
  <xsl:value-of select="ns1:CommonInvoiceLineElements/ns1:FreightRate/ns1:FreightCharge/ns1:FinancialAmount/ns1:MonetaryAmount"/>
</ns0:amount>

我想了解这一点的原因是,我相信下面的代码段与此块一起返回的是一个正值,而传递给它的是一个负数


提前谢谢

ns1是一个前缀,用于选择命名空间中的元素。样式表中的某个地方有一个名称空间声明,将此前缀绑定到名称空间URI,形式如下:

xmlns:ns1="some/string"
在源XML中的某个地方,有一个类似的名称空间声明,将其部分或全部元素放置在此名称空间中。您需要使用绑定到同一命名空间URI的前缀来选择此命名空间中的元素

我相信下面这个代码段返回的是一个 传递负数时的数值的正值 去吧


我看不出这种信念的根据。为什么不发布一个(最小化的)示例来说明问题。

它不是
nsl
,而是
ns1
,最后一个字符是一个。不幸的是,我没有时间给出完整的答案,但请寻找“XML名称空间”。这些名称空间也可以用于XPath查询(在
select=”“
)中。“我已经在互联网上搜索了…”您需要找到一种更有效的学习策略。如果你不知道ns1是一个名称空间前缀,那么互联网不会告诉你。阅读一本关于XPath的书(甚至阅读W3C规范)会让你更快地找到答案。