I am preparing one flat file from XMl using XSLT 2.0. My input XML is
<city>
<family>
<parent>A</parent>
<child>A1</child>
</family>
<family>
<parent>A</parent>
<child>A2</child>
</family>
<family>
<parent>B</parent>
<child>B1</child>
</family>
<family>
<parent>B</parent>
<child>B2</child>
</family>
<family>
<parent>B</parent>
<child>B3</child>
</family>
<family>
<parent>C</parent>
<child>C1</child>
</family>
</city>
Expected Output
-----------------
01 A
02 B
03 C
I have to group parent and each parent has one entry in flat file and it should have correct sequence no. I am not able to generate sequence no correcly.
Assuming you use
for-each-group
then outputting and formatting theposition()
should suffice: