Hello,
I am trying to find out using the DOM API if I could recursively parse an XML, based on certain tag name and split it into multiple XMLs. These XMLs (
String datatype) will be fed into methods for further processing. I am using JDK 1.4.2.
Here's a sample XML -
<?xml version="1.0" encoding="iso-8859-2" ?>
<People>
<Person>
<Father>
<Name>John Doe</Name>
<Age>35</Age>
</Father>
<Child>
<Name>John Doe Jr.</Name>
<Age>1</Age>
</Child>
</Person>
<Person>
<Father>
<Name>Bill Moe</Name>
<Age>40</Age>
</Father>
<Child>
<Name>Bill Moe Jr.</Name>
<Age>2</Age>
</Child>
</Person>
</People>
The output XMLs -
<Person>
<Father>
<Name>John Doe</Name>
<Age>35</Age>
</Father>
<Child>
<Name>John Doe Jr.</Name>
<Age>1</Age>
</Child>
</Person>
and
<Person>
<Father>
<Name>Bill Moe</Name>
<Age>40</Age>
</Father>
<Child>
<Name>Bill Moe Jr.</Name>
<Age>2</Age>
</Child>
</Person>
What would be the best way to do this?
Thanks!