[PHP] Simple question on simplexml

2007-04-06 Thread Timothy Murphy
I have a catalog in XML format: ?xml version=1.0 encoding=iso-8859-1 ? catalog book ... book book ... book ... /catalog Now I want to add another book, which I have as a SimpleXMLElement: $book = new SimpleXMLElement($string); where $string reads book ... book

Re: [PHP] Simple question on simplexml

2007-04-06 Thread Jochem Maas
there is this: http://php.net/manual/en/function.simplexml-element-addChild.php which will allow adding of string data (so you won't be needing to create the new SimpleXMLElement object as per your example below). obviously you will have to first load tghe complete xml document into simplexml