Re: Empty xpath nodelist raises foreach error.

From: Date: Wed, 03 Mar 2004 12:05:28 +0000
Subject: Re: Empty xpath nodelist raises foreach error.
References: 1 2 3  Groups: php.xml.dev 
Request: Send a blank email to php-xml-dev+get-340@lists.php.net to get a copy of this message
Can you send me the code you are using? There is current one place where an error is not issued and that only happens when your xpath expression is invalid and results in a libxml xpath error. An error message should most likely be added here. If this is the case, then you should not get a nodelist back. Rob > > From: Philip Fletcher > >> When using foreach() with an xpath query, if the xpath result is an empty > >> set, then foreach raises a 'Warning: Invalid argument supplied for > >> foreach()' message. This should not really be raised, as (for foreach()) > >> the xpath return should be a valid (but empty)

« previous php.xml.dev (#340) next »