Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   XML (http://www.velocityreviews.com/forums/f32-xml.html)
-   -   java DOM: hide prefix from app (http://www.velocityreviews.com/forums/t166557-java-dom-hide-prefix-from-app.html)

Thomas Jollans 02-04-2004 04:24 PM

java DOM: hide prefix from app
 
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

Anton Spaans 02-04-2004 04:37 PM

Re: java DOM: hide prefix from app
 

"Thomas Jollans" <nospam@jollans.com> wrote in message
news:bvr6bc$nli$06$1@news.t-online.com...
> 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.




All times are GMT. The time now is 12:37 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.