• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to mask part of xml

 
Raghunath Nandyala
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic