#28689 [NEW]: Without registerNamespace() method, XPath function is crippled

From: Date: Tue, 08 Jun 2004 01:06:17 +0000
Subject: #28689 [NEW]: Without registerNamespace() method, XPath function is crippled
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-60532@lists.php.net to get a copy of this message
From: davey@php.net Operating system: Irrelevant PHP version: 5.0.0RC2 PHP Bug Type: SimpleXML related Bug description: Without registerNamespace() method, XPath function is crippled Description: ------------ Because XPath cannot select nodes from the default namespace (i.e. xmlns="foo") an alias must be added. This is possible in the DOM extension using the DomXpath::registerNamespace() method. Because SimpleXML does not have this, its XPath implementation is quite crippled. The only way around this is the following: $sxml = simplexml_load_*($xml) $sxml['xmlns:foo'] = 'http://foo'; $sxml = simplexml_load_string($sxml->asXML()); Which is quite stupid really. - Davey -- Edit bug report at http://bugs.php.net/?id=28689&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28689&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28689&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=28689&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=28689&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=28689&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=28689&r=needscript Try newer version: http://bugs.php.net/fix.php?id=28689&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=28689&r=support Expected behavior: http://bugs.php.net/fix.php?id=28689&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=28689&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=28689&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=28689&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28689&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=28689&r=dst IIS Stability: http://bugs.php.net/fix.php?id=28689&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=28689&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=28689&r=float

« previous php.bugs (#60532) next »