Re: [PHP] Some help with SimpleXML :`(

2009-09-04 Thread Matthew Croud
Well, you guys are awesome. So the script below doesn't cause any errors (nice), however it doesn't save the newly added child to the xml file (items.xml): $xml = simplexml_load_file(items.xml); $item = $xml-addChild('item'); $item-addChild('name', $name); $item-addChild('desc', $desc);

[PHP] Some help with SimpleXML :`(

2009-09-04 Thread J DeBord
On Fri, Sep 4, 2009 at 10:23 AM, Matthew Croud m...@obviousdigital.comwrote: Well, you guys are awesome. So the script below doesn't cause any errors (nice), however it doesn't save the newly added child to the xml file (items.xml): $xml = simplexml_load_file(items.xml); $item =

[PHP] Some help with SimpleXML :`(

2009-09-03 Thread Matthew Croud
Hi foks, Could someone lend me a little hand with simpleXML ? I've been looking at examples in the PHP manual and W3C, i'm at the pinnacle of figuring it out but alas i need a hand from the mailing list dudes. My aim is to add another item node, so i'll start with my XML file called

Re: [PHP] Some help with SimpleXML :`(

2009-09-03 Thread J DeBord
You almost had it... Since clothes is the root element you can think of your initial $xml as clothes. So, you add a child to it. That error message is kinda cryptic though. ?php $xml = EOD ?xml version=1.0 encoding=iso-8859-1? clothes item nameRed Gloves/name desca pair of red