Я пытаюсь получить Положение для каждой итерации, чтобы использовать ее для другой переменной, но она не работает и выбирает только первое значение.
Фрагмент 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>
</Payment>
</xsl:for-each>