Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54722 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59301 invoked from network); 19 Aug 2011 12:02:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Aug 2011 12:02:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=rrichards@cdatazone.org; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=rrichards@cdatazone.org; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain cdatazone.org does not designate 207.58.142.213 as permitted sender) X-PHP-List-Original-Sender: rrichards@cdatazone.org X-Host-Fingerprint: 207.58.142.213 smtp2go.com Linux 2.6 Received: from [207.58.142.213] ([207.58.142.213:37722] helo=smtp2go.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8B/89-11562-0D05E4E4 for ; Fri, 19 Aug 2011 08:02:25 -0400 Received: from dsl-67-158-171-203.fairpoint.net ([67.158.171.203] helo=Rob-Richardss-MacBook-Pro.local) by smtp2go.com with esmtp (Exim 4.69) (envelope-from ) id 1QuNmH-0006Gb-Iz; Fri, 19 Aug 2011 12:02:21 +0000 Message-ID: <4E4E50CD.3000509@cdatazone.org> Date: Fri, 19 Aug 2011 08:02:21 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0) Gecko/20110812 Thunderbird/6.0 MIME-Version: 1.0 To: Nicolai Scheer CC: internals@lists.php.net References: <42854.62.156.253.205.1313749679.squirrel@xa8.serverdomain.org> <46024.62.156.253.205.1313751878.squirrel@xa8.serverdomain.org> In-Reply-To: <46024.62.156.253.205.1313751878.squirrel@xa8.serverdomain.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] libxml returns codes and xmlreader From: rrichards@cdatazone.org (Rob Richards) On 8/19/11 7:04 AM, Nicolai Scheer wrote: > > Hi! > >> On Fri, Aug 19, 2011 at 12:27, Nicolai Scheer > >> 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