From:             adam at trachtenberg dot com
Operating system: Mac OS X
PHP version:      5CVS-2003-11-06 (dev)
PHP Bug Type:     XML related
Bug description:  SimpleXML XPath doesn't support namespaces

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 bug report at http://bugs.php.net/?id=26159&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26159&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26159&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26159&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26159&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26159&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=26159&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26159&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26159&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26159&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26159&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26159&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26159&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26159&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26159&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26159&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26159&r=float

Reply via email to