vendredi 31 juillet 2015

How do I remove the root element of an XML document?

I want to remove the root element from an following xml using Java:

<BookRequest xsi:schemaLocation="http://test/books.xsd">
 <Book>
 <Name>abc</Name>
 <Author>xyz</Author>
 </Book>
</BookRequest>

so that I will only have this as the final output:

<Book>
 <Name>abc</Name>
 <Author>xyz</Author>
</Book>

How can I do this?

Aucun commentaire:

Enregistrer un commentaire