@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, I
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);
}
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 =
Hi,
I probably have a stupid question... how can I add a node into an existing
simplexml object.
I create the object by
$xml = simplexml_load_file('test.xml');
the xml file shows like this:
?xml version='1.0'?
config
/config
Thanks for help...
--
PHP General Mailing List
php.net/dom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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);
}
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);
}
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 overhead
8 matches
Mail list logo