Re: appendChild help?
Brought to you by:
bs_php,
nigelswinson
From: Girish N. <gi...@bt...> - 2001-11-06 11:44:24
|
Hi I've been trying to figure this out too. The only way can do it is to appendChild() then appendData() into that child. $xml->appendChild("/root[1]", "newchild"); $xml->appendData("/root[1]/newchild[1]", "some new data here"); It would be nice to be able to to this in one step. Any help appreciated. Girish ----- Original Message ----- From: "Paul / USH" <pa...@tr...> To: <php...@li...> Sent: Tuesday, November 06, 2001 11:19 AM Subject: appendChild help? > I'm using Php.XPath Version 2.1 and I'm having some trouble understanding what to pass into appendChild as the node. > > Could someone give me a simple example of appending a child to a node. > > e.g. > > file contents are <root></root> > $xml = new XPath("$filename"); > $xml->appendData("/root[1]", "blah" ); > > What do I put in instead of "blah" to add a node called blah? > > Paul > www.nostalgiagoggles.com > > > > _______________________________________________ > Phpxpath-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpxpath-users |