E
Eddy C
I'm trying to strip an XML document of unwanted nodes such that in the
example below I would keep all the parent nodes of a child node I
wanted and for other parents which do not have the child requested they
would be stripped.
I understand I could use XSLT but I'm doing this in java and was
wondering if there was a preferred approach out there.
Before
<a>
<b>
<c>fdfdsf</c>
</b>
<b>
<x>dffsd</x>
</b>
<b>
<x>dffsd</x>
<c>fdfdsf</c>
</b>
</a>
After requesting to keep child c
<a>
<b>
<c>fdfdsf</c>
</b>
<b>
<c>fdfdsf</c>
</b>
</a>
example below I would keep all the parent nodes of a child node I
wanted and for other parents which do not have the child requested they
would be stripped.
I understand I could use XSLT but I'm doing this in java and was
wondering if there was a preferred approach out there.
Before
<a>
<b>
<c>fdfdsf</c>
</b>
<b>
<x>dffsd</x>
</b>
<b>
<x>dffsd</x>
<c>fdfdsf</c>
</b>
</a>
After requesting to keep child c
<a>
<b>
<c>fdfdsf</c>
</b>
<b>
<c>fdfdsf</c>
</b>
</a>