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
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
2 matches
Mail list logo