Re: [PHP-XML-DEV] Empty xpath nodelist raises foreach error.
[email protected] ("Rob Richards") Wed, 3 Mar 2004 07:05:28 -0500
| Newsgroups | php.xml.dev |
|---|---|
| Message-ID | <[email protected]> |
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)