my dog learned polymorphism*
The moose likes HTML, CSS and JavaScript and the fly likes help with removing child node Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "help with removing child node" Watch "help with removing child node" New topic
Author

help with removing child node

karthik sudarshan
Greenhorn

Joined: May 25, 2007
Posts: 4
Hi All, I have a DOM xml as follows

<pXML>
<Type>Trial</Type>
<SXML>
<Record FREQ="Monthly" MODE="Advanced" >
<PText p_text="abc."/>
<PText p_text="xyz."/>
</Record>
</SXML>
</pXML>

I want to delete only the 2nd child of Record (p_text = "xyz")
Now assuming I have named my xml as xmlDOM, this call actually points to the node I want to delete

alert(xmlDOM.documentElement.childNodes(1).childNodes(0).childNodes(1));

I now need some help to delete this childnode only. I want to retain the p_text = "abc".

Thanks in advance
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

You are asking how to do that in Javascript, right? I think that question would get a better answer in our HTML and Javascript forum.
 
Don't get me started about those stupid light bulbs.
 
subject: help with removing child node
 
Similar Threads
Can JAXB unmarshals child elements
node() test condition
Add elements to already created XML
Get data by Matching ID's from two different XML documents
XPath for atrib. name and value of node