php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29782 Invalid XPath Context error when ZE1 compatibility mode is enabled
Submitted: 2004-08-21 13:57 UTC Modified: 2004-09-24 08:30 UTC
From: jw at jwscripts dot com Assigned:
Status: Closed Package: XSLT related
PHP Version: 5.0.1 OS: Windows XP & 2000 / FreeBSD
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
50 + 6 = ?
Subscribe to this entry?

 
 [2004-08-21 13:57 UTC] jw at jwscripts dot com
Description:
------------
When the ZE1 compatibility has been enabled (in php.ini: zend.ze1_compatibility_mode=On), the usage of domXpath::query() results in an Invalid XPath Context error.

There are no problems when the ZE1 compatibility is disabled.



Reproduce code:
---------------
$dom = new domDocument;
$dom->loadXML("<root> hello </root>");
$xpath = new domXPath($dom);
$results = $xpath->query('//root');

echo "<b>Node value:</b> ", $results->item(0)->nodeValue;

Expected result:
----------------
Node value: hello

Actual result:
--------------
Warning: Invalid XPath Context in [...] on line [...]


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-21 14:01 UTC] jw at jwscripts dot com
Also applies to Windows 2000 and FreeBSD installations.
 [2004-09-23 18:56 UTC] chregu@php.net
can you please check a recent snapshot and see if the problem persists?
 [2004-09-23 22:10 UTC] jw at jwscripts dot com
I have downloaded and tried 5.0.2RC2 and the problem seems to be fixed. 

The only "problem" was the obvious warning about object cloning (the instances from the DOM classes should be created by reference with ZE1 compatibility).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 13 22:01:31 2024 UTC