Skip to Content
0
Former Member
Aug 29, 2007 at 06:05 AM

Accessing Parent Node of an XML through XSLT

24 Views

Hi,

I want to loop at the child node and need to find out its parent node.

Kindly let me know how to traverse back using XSLT.

<u><b>sample source structure:</b></u>

<level1>

<level2>

<level 3>

<part number> 123 </part number>

</level3>

<level3>

<part number> 1 </part number>

</part number> 2 </part number>

</level3>

</level2>

</level1>

<u><b>target:</b></u>

<group>

<part Number> 123 </part number>

<level3> </level3>

<level2> </level2>

<level1> </level1>

</group>

<group>

<part Number> 1</part number>

<level3> </level3>

<level2> </level2>

<level1> </level1>

</group>

<part Number> 2 </part number>

<level3> </level3>

<level2> </level2>

<level1> </level1>

</group>

Kindly let me know how to traverse back by looping at the part number.

Regards,

Swaroopa