Re: For Deleting child
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: For Deleting child

From: Lasse Reichstein Nielsen <lrn@hotpop.com>
Date: Tue Feb 28 2006 - 18:03:19 CET

"pramod" <lnmipramod@gmail.com> writes:

> will u suggest me how to delete child from node.

PLEASE write entire words. Phonetic abbreviations are significantly
harder to read for non-native English speakers.

> i have a xml file . There are four subnodes in the Contact element
> i have to delete subnodes value from file

I can't tell you how to delete something in the file without knowing
what file operations you can perform and how. Since you are posting in
a Javascript group, I am guessing that you want to use W3C DOM for
manipulating the XML. If you read the file into a DOM structure, you
can remove a child node from another node by using the (unsurpricingly
named) "removeChild" method, i.e.:
  parentNode.removeChild(childNode);
You will then have to write the DOM to a file again.

/L

-- 
Lasse Reichstein Nielsen  -  lrn@hotpop.com
 DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
  'Faith without judgement merely degrades the spirit divine.'
Received on Mon May 1 03:41:18 2006