• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to mask part of xml

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic