Is there a better way to remove selected nodes from XML using Javascript? I see that removeChild() method can be used. But I don't want to traverse through the entire XML tree right to the bottom where the to-be replaced node is stuck. In simple, I should be able to fly right to my node of interest and replace its contents.
Add a comment
|
2 Answers
Check out http://api.jquery.com/jQuery.parseXML/
$.parseXML("well formed xml document").find('css selector to find element to remove').remove()