Quantcast
Channel: Split XML using a Xpath Java - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Split XML using a Xpath Java

$
0
0

I have following XML string.

<Engineers><Engineer><Name>JOHN</Name><Position>STL</Position><Team>SS</Team></Engineer><Engineer><Name>UDAY</Name><Position>TL</Position><Team>SG</Team></Engineer><Engineer><Name>INDRA</Name><Position>Director</Position><Team>PP</Team></Engineer></Engineers>

I need to split this xml into smaller xml strings when Xpath is given as Engineers/Enginner.

Smaller xml strings are as follows

<Engineers><Engineer><Name>INDRA</Name><Position>Director</Position><Team>PP</Team></Engineer></Engineers><Engineers><Engineer><Name>JOHN</Name><Position>STL</Position><Team>SS</Team></Engineer></Engineers>

How can I do this using Java document builder and XpathFactory?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images