Re: [PHP] SimpleXML add a node

2005-03-13 Thread Claudio
@richard > I dunno about that whole try/catch thing, but if you're not going to USE > it to catch the errors, then you might as well be old school and check the > return values of all these functions. that sounds good, but , so far I know, if the API says that a function _can_ throw an exception,

Re: [PHP] SimpleXML add a node

2005-03-12 Thread Jochem Maas
Jochem Maas wrote: Richard Lynch wrote: php.net/dom ?? Like this? --- try { $dom = new DOMDocument(); $config = $dom->appendChild($dom->importNode(dom_import_simplexml($this->configXML),true)); $config->appendChild( $dom->createElement(($mode? 'softactive':'active')) ); $this->configXML = simp

Re: [PHP] SimpleXML add a node

2005-03-12 Thread Jochem Maas
Richard Lynch wrote: php.net/dom ?? Like this? --- try { $dom = new DOMDocument(); $config = $dom->appendChild($dom->importNode(dom_import_simplexml($this->configXML),true)); $config->appendChild( $dom->createElement(($mode? 'softactive':'active')) ); $this->configXML = simplexml_import_dom($config

Re: [PHP] SimpleXML add a node

2005-03-11 Thread Jason Barnett
Richard Lynch wrote: ... >> >>} catch(Exception $e) {} > > > I dunno about that whole try/catch thing, but if you're not going to USE > it to catch the errors, then you might as well be old school and check the > return values of all these functions. > Agreed 100%. No sense in going through the o

Re: [PHP] SimpleXML add a node

2005-03-11 Thread Richard Lynch
>> php.net/dom > > ?? > > Like this? > > --- > > try { > > $dom = new DOMDocument(); > > $config = > $dom->appendChild($dom->importNode(dom_import_simplexml($this->configXML),true)); > > $config->appendChild( $dom->createElement(($mode? 'softactive':'active')) > ); > > $this->configXML = simplexml

Re: [PHP] SimpleXML add a node

2005-03-11 Thread Claudio
> php.net/dom ?? Like this? --- try { $dom = new DOMDocument(); $config = $dom->appendChild($dom->importNode(dom_import_simplexml($this->configXML),true)); $config->appendChild( $dom->createElement(($mode? 'softactive':'active')) ); $this->configXML = simplexml_import_dom($config); } catc

Re: [PHP] SimpleXML add a node

2005-03-11 Thread Guillermo Rauch
php.net/dom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php