ID: 26159 Updated by: [EMAIL PROTECTED] Reported By: adam at trachtenberg dot com -Status: Open +Status: Closed Bug Type: XML related Operating System: Mac OS X PHP Version: 5CVS-2003-11-06 (dev) New Comment:
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. Previous Comments: ------------------------------------------------------------------------ [2003-11-06 20:34:26] 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.) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26159&edit=1