Re: SimpleXML add a node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 of creating
Exceptions (which are objects BTW) if you're not even going to use it in
any way at all.  Exceptions take a lot of work to build / manage so for
small projects it's really not even worth the time.

>
>>It ist strange... It runs one time, the second time I receive the
>>following
>>error.
>
>
> Since it "works" once and not the second time, I'd be looking to see if
> the XML produced on the first go-around is actually VALID, since, if it's
> not, that would cause this problem, I think.
>

A good point.  Not only that... if you are trying to convert from
simpleXML to DOM then you need dom_import_simplexml()

http://php.net/manual/en/function.dom-import-simplexml.php

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux