php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26159 SimpleXML XPath doesn't support namespaces
Submitted: 2003-11-06 20:34 UTC Modified: 2003-11-24 06:22 UTC
From: adam at trachtenberg dot com Assigned:
Status: Closed Package: XML related
PHP Version: 5CVS-2003-11-06 (dev) OS: Mac OS X
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: adam at trachtenberg dot com
New email:
PHP Version: OS:

 

 [2003-11-06 20:34 UTC] adam at trachtenberg dot com
Description:
------------
Trying to do an XPath search on a SimpleXML object fails 
when the XML document contains namespaces.

Expected result:
----------------
The object should automatically register any prefixes 
defined using xmlns:foo="http://www.example.com" syntax 
in the document and also use any namespaces added 
using registerNS().

Actual result:
--------------
The following patch http://www.trachtenberg.com/patches/
simplexml_xpath_ns_patch.txt fixes both issues. (Note 
that the default namespace *is not* automatically 
registered, but that's a fault of the XPath spec, not 
the code. So you still need to manually register it.)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-24 06:22 UTC] rrichards@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 17:01:33 2024 UTC