File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes How to mask part of xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to mask part of xml" Watch "How to mask part of xml" New topic
Author

How to mask part of xml

Raghunath Nandyala
Ranch Hand

Joined: Jan 24, 2006
Posts: 64
Hi
Im having one xml,like
<root>
<name>Raj</name>
<Info>Cron</Info>
</root>
<!-- Huge xml of 300 elements -->

I want to mask the above xml into same xml,but masking Info node with XXXX

the input for this one is list of nodes and attributes to mask
and out put is same xml with masked data..

I can do by
1)parsing xml as string object (im going for this)
2)Using DOM
3)reading thru SAX and filling into new doc using DOM

which way is better, and is there any way better way,

How about XSLT,??

Plase suggest me.

Thanks
Raghunath N


SCBCD,SCWCD,SCJP
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


How about XSLT,??

That would be my choice. You can just apply a template that creates the DOM you require. Transforming XML is after all the only purpose of XSLT.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
 
subject: How to mask part of xml