File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion 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

How to mask part of xml

Raghunath Nandyala
Ranch Hand

Joined: Jan 24, 2006
Posts: 64
Im having one xml,like
<!-- 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.

Raghunath N

Paul Sturrock

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
I agree. Here's the link:
subject: How to mask part of xml
It's not a secret anymore!