I am struggling to achieve something that should be very simple using XSLT1.0, so please bear with me.
This is my original XML:
<adapter-response>
<status>success</status>
<data>
<inventory>
<servers>
….
….
</servers>
<routers>
….
….
</routers>
…
…
</inventory>
</adapter-response>
Its a huge XML with lots of data. I just want to strip out the adapter related tags and keep the inventory data with the original tags. So the final XML would be:
<inventory>
<servers>
….
….
</servers>
<routers>
….
….
</routers>
…
…
</inventory>
Please help!
Regards,
Rahul
The provided “sketch” of an XML document is not well-formed, so my reconstruction of the document maynot be the one that was intended in the question:
This transformation:
copies to the output only elements, whose name doesn’t contain the string
"adapter". THe result for the above document is: