-1

how to hide some specified nodes from XML data for example my XML data is like this

<note>
<to>Tove</to>
<from>
   <primary>hyd</primary>
   <secondary>delhi</secondary>
</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>

i want to hide from tag and child nodes while i am displaying this data in a page using java script or jquery.

1 Answers1

2

Well try to parse it, once you've loaded it up into an object, you can manipulate it however you like.

How to parse it, can be found here.

Try if something like this works (using jQuery 1.5 or newer):

var xml = '<note> <to>Tove</to> <from> <primary>hyd</primary> <secondary>delhi</secondary> </from> <heading>Reminder</heading> <body>Dont forget me this weekend! </body></note > ';

var parsedXml = $.parseXML(xml);

$(parsedXml).find('form').remove();
Community
  • 1
  • 1
avidenic
  • 653
  • 7
  • 17