Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Accessing Parent Node of an XML through XSLT

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

Former Member
Not what you were looking for? View more on this topic or Ask a question