Re: appendChild help?
Brought to you by:
bs_php,
nigelswinson
From: Paul / U. <pa...@tr...> - 2001-11-06 14:30:58
|
On 06 Nov 2001 11:41 GMT you wrote: > 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"); Thankyou, you've just solved my initial problem I was using appendData - when I should have been using appendChild first. Paul www.nostalgiagoggles.com > > 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 |