In my input XML file, there are maybe several loop blocks, I need to mark these loop as 1, 2, 3,... in the output file. I am using XSLT 2.0.
The input file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<request>
<dateTime year="2012" month="05"/>
<telephoneNumber TN="2603732125" >
<detail value="0" tag="CF"/>
</telephoneNumber>
<telephoneNumber TN="2603732136">
<detail value="B" tag="TXTYP"/>
</telephoneNumber>
</request>
Output XML should be:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<edi>
<ISA>
<GS>
<TS>
<SLN>
<SLN02>1</SLN02>
<SLN05>EA</SLN05>
</SLN>
<SI>
<SI02>RQ</SI02>
<SI03>2603732136</SI03>
</SI>
<SLN>
<SLN02>2</SLN02>
<SLN05>EA</SLN05>
</SLN>
<SI>
<SI02>RQ</SI02>
<SI03>2603732136</SI03>
</SI>
</TS>
</GS>
</ISA>
</edi>
For each telephoneNumber node, I need to create the SLN node, as make the SI02 as the the sequence number from 1. I do not know how to do this in XSLT.
Thank you in advance for any help.