sajan Posted December 10, 2007 Share Posted December 10, 2007 How remove a child node from xml file? When i try to remove i got error message.Warning: DOMNode::removeChild() expects parameter 1 to be DOMNode, string given'code $xmlDoc = new DOMDocument();$xmlDoc->load($file); $x = $xmlDoc->documentElement;$rootT=$x->tagName;//$result is an array for($i=0;$i<sizeof($result);$i++) { $root = $xmlDoc->getElementsByTagName($rootT)->item(0); $root->removeChild($result[$i]); }$xmlDoc->save($file); What may be the problem? Link to comment Share on other sites More sharing options...
sajan Posted December 10, 2007 Author Share Posted December 10, 2007 I got it Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.