Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Removal of XML doc root node

843834Jun 11 2003 — edited Jun 11 2003
What would be the most efficient way to remove just the root node element from an XML doc? The remainder of the document needs to be preserved.

I did not think XSLT would be appropriate given that not much processing needs to be done. Additional approaches I was thinking
about -
1) Manually stripping the root node using StringTokenizer.
2) With SAX, on startElement callback, echo the element and attributes to a StringBuffer if the element is not the root node.

Any advice would be appreciated. Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 9 2003
Added on Jun 11 2003
1 comment
382 views