On 8/19/11 7:04 AM, Nicolai Scheer wrote:

Hi!

On Fri, Aug 19, 2011 at 12:27, Nicolai Scheer
<sc...@planetavent.de>
wrote:
I've
noticed, that some of the libxml return codes

get
"simplified" when used in xmlreader which can
be quite
problematic.
Use
libxml_get_errors()

So you're suggesting to call another
function rather than returning something that is already there?

I see how libxml_get_errors() can be used to work around this, but to my
mind, this function should not be called unless I know that in fact there
are errors.

Nevertheless, is there a "real" reason
why this is not implemented? Anyone else feeling uncomfortable with
"calling additional functions to check for error conditions"?

Greetings,

Nico




It is modeled after the .NET XMLReader interface with simple boolean return values. You can file a feature request to enable exceptions to be thrown from the reader on invalid XML. i.e. argument to constructor whether or not to throw exceptions (default false). Right now regardless of returning false or an int value, you would have to check something to determine if it were an error or no data (either a function as it is right now or for a specific return value), so it's always an extra step.

Rob

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to