Get nodes value one by one in xslt
- by Audy
I am using XSl file in which I am reading values from xml node and creating another xml file. Following is the part of input xml from which I want to read value node one by one.
Input Xml:
<RoomsInvs>
<RoomInv>
<ProvisionalId Id="13-0000000007">13-0000000007</ProvisionalId>
</RoomInv>
<RoomInv>
<ProvisionalId Id="13-0000000008">13-0000000008</ProvisionalId>
</RoomInv>
</RoomsInvs>
Xsl Applied:
<values>
<xsl:apply-templates select="//RoomsInvs/RoomInv" />
</values>
<xsl:template match="RoomInv" >
<tempID>
<xsl:value-of select="ProvisionalId[position()]"/>
</tempID>
</xsl:template>
Output Getting:
<values>
<tempID>13-0000000007</tempID>
<tempID>13-0000000007</tempID>
</values>
Output I want:
<values>
<tempID>13-0000000007</tempID>
<tempID>13-0000000008</tempID>
</values>