Reputation: 1
i got a problem with a parser.
i want to parse an xml structured like this:
<item>
...
<notes>
<item>
</item>
<item>
</item>
</notes>
</item>
notes is a child of the first item und the other items are childs of notes. if i want to parse this i get the notes as normal items.
i thought it would be simple if i just rename the childs of notes to "noteitem"
is there a simple way to do this in Java?
thank you and sorry for my bad english!
Upvotes: 0
Views: 76
Reputation: 35453
As stated in my comment, if you really want to do what you stated, an XSLT us an option. Just define a style sheet transformation, apply it to the original input document and then parse the results of the transform as XML.
Here is a good starting point: http://docs.oracle.com/javase/tutorial/jaxp/xslt/transformingXML.html
Upvotes: 1