note 88232 deleted from simplexmlelement.registerXPathNamespace by danbrown
| From: | danbrown@php.net | Date: | Fri, 28 Jan 2011 14:33:14 +0000 |
| Subject: | note 88232 deleted from simplexmlelement.registerXPathNamespace by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-176448@lists.php.net to get a copy of this message | ||
Note Submitter: remy dot damour at -please-no-spam-laposte dot net
----
Registering xpath-namespaces is mandatory when your input xml has a default namespace.
Unfortunately an empty prefix '' cannot be registered, I use 'default' as
prefix:
<?php
$sxe->registerXPathNamespace('default', 'mynamespace');
// then
$sxe->xpath('//default:nodename');
?>
Bad news is that xpath-namespaces must be registered on EVERY SimpleXMLElement on which ->xpath()
is to be called! (registering it on root node is not sufficient)