Sometimes we come across scenarios where we need to map uneven repeating nodes in Source and Target. In such a case we need to use the indexing carefully.
Use <xsl:variable name="FirstLevel1Index" select="position()"/> for holding the position of each loop.
Tips and Tricks 1: Mapping uneven repeating nodes between Source and Target
Use <xsl:variable name="FirstLevel1Index" select="position()"/> for holding the position of each loop.
<xsl:for-each
select="/Xpath1 ">
<xsl:variable name="Counter1"
select="position()"/>
<xsl:for-each select="/Xpath1[$Counter1]/Xpath2 ">
<xsl:variable
name="Counter2" select="position()"/>
<!--
Mapping -->
</xsl:for-each>
</xsl:for-each>