java DOM: hide prefix from app

T

Thomas Jollans

i have an xml file

<p:tag_one xmlns='ns'>
<p:tag_two>
text
</p:tag_two>
<p:tag_three/>
</p:tag_one>

and want p:tag_two to be tag_two for the app, p:tag_one to be tag_one...
how do i do this with java xml dom?

thanx in advance,
thomas
 
A

Anton Spaans

Thomas Jollans said:
i have an xml file

<p:tag_one xmlns='ns'>
<p:tag_two>
text
</p:tag_two>
<p:tag_three/>
</p:tag_one>

and want p:tag_two to be tag_two for the app, p:tag_one to be tag_one...
how do i do this with java xml dom?

thanx in advance,
thomas

Walk the entire tree-structure of the original XML document (with the p
prefix). While doing that, copy each node and make a copy of the original
XML. But use the getLocalName method/attribute instead of the getNodeName
(the actual method names may be spelled a little differently, though).

Or use an XSL transformation do to the same.

-- Anton.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top