在XSLT中获取每次迭代的位置

时间:2018-09-12 16:39:34

标签: xslt

我试图获取for-for迭代的位置,以将其用于不同的变量,但它不起作用,并且仅选择第一个值。

XSLT代码段

    <xsl:for-each select="imp1:GroupRecord-200">
          <xsl:variable name="i">
        <xsl:value-of select="position()"/>
      </xsl:variable>
            <Payment>
              <RecordType>
                <xsl:value-of select="normalize-space(imp1:Record-6/imp1:Field-LDR1)"/>
              </RecordType>
              <BatchName>
                <xsl:value-of select="$varBatchNum"/>
              </BatchName>
              <ItemNumber>
                <xsl:value-of select="normalize-space(imp1:Record-6/imp1:Field-LDR-3)"/>
              </ItemNumber>
              <RemittanceAmount>
                <xsl:value-of select="normalize-space(imp1:Record-6/imp1:Field-LDR4)"/>
              </RemittanceAmount>
              <TransitRoutingNumber>
                <xsl:value-of select="normalize-space(imp1:Record-6/imp1:Field-LDR5)"/>
              </TransitRoutingNumber>
              <Account>
                <xsl:value-of select="normalize-space(imp1:Record-6/imp1:Field-LDR6-1)"/>
              </Account>
              <OperatingUnit>
                <xsl:value-of select="$TempVariable_1/ns1:PNCBAI_LOCKBOX_1[position()=$i]/ns1:OU_Name_1"/>
              </OperatingUnit>
              <PaymentsNumber>
                <xsl:value-of select="$TempVariable_1/ns1:PNCBAI_LOCKBOX_1[position()=$i]/ns1:Invoice_Number_1"/>
              </PaymentsNumber>
              <NetInvoiceAmount>
                <xsl:value-of select="normalize-space(imp1:Record-6/imp1:Field-LDR9-01)"/>
              </NetInvoiceAmount>
              <CustomerNumber>
                <xsl:value-of select="normalize-space(imp1:Record-6/imp1:Field-LDR7-1)"/>
              </CustomerNumber>
               </xsl:for-each>

0 个答案:

没有答案