php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17032 Results of "xpath_eval(...)" are not right in all cases
Submitted: 2002-05-06 03:53 UTC Modified: 2002-06-07 09:48 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: ggabriel at ets-online dot de Assigned:
Status: Closed Package: DOM XML related
PHP Version: 4.2.0 OS: Win2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ggabriel at ets-online dot de
New email:
PHP Version: OS:

 

 [2002-05-06 03:53 UTC] ggabriel at ets-online dot de
For the following sample:

<foo>
    <oops>
      some data
    </oops>
</foo>

the following problem occured:
$expr1 = "//foo";
$expr2 = "//*[name()='foo']";

$path1 = xpath_eval($context, $expr1); # no result ??? WRONG
$path2 = xpath_eval($context, $expr2); # one result !!! OK

The two expressions "//foo" and "//*[name()='foo']" should lead to the same result, but they do not.
I have turned Off all magic_quotes in php.ini .

It's to mention, that I use the PHP 4.2.0 Extensions for DOM XML support in my PHP 4.1.0 Version.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-06 04:02 UTC] derick@php.net
Please do not submit the same bug more than once.
 [2002-05-06 04:26 UTC] mfischer@php.net
Re-Opening (sample is right, no entities).
 [2002-06-07 06:35 UTC] bigredlinux at yahoo dot com
I have been married to this extension for the last several months, so I thought I would report some info.  The DOM extension as of 4.2.1 is behaving correctly, I get the expected 1 result for both queries.  Perhaps the user does not have a recent enough version of libxml2 (the extension was allowing this prior to php 4.2.1).  Anyway, this would not be a bug in the php extension even if it didn't work, but rather the underlying libraries and would be appropriate for the libxml2 mailing list.  Close this bug, it works.
 [2002-06-07 09:48 UTC] jtate@php.net
Fixed in 4.2.1 as reported by Dan.  If it is not, please reopen.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Fri Feb 13 09:00:01 2026 UTC