note 84795 modified in function.simplexml-element-registerXPathNamespace by danbrown
| From: | danbrown@php.net | Date: | Wed, 16 Sep 2009 15:57:14 +0000 |
| Subject: | note 84795 modified in function.simplexml-element-registerXPathNamespace by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-160703@lists.php.net to get a copy of this message | ||
A handy timesaver:
<?php
$sxe = simplexml_load_file($path);
//Fetch all namespaces
$namespaces = $sxe->getNamespaces(true);
//Register them with their prefixes
foreach ($namespaces as $prefix => $ns) {
$sxe->registerXPathNamespace($prefix, $ns);
}
?>
--was--
A handy timesaver:
<?php
$sxe = simplexml_load_file($path);
//Fetch all namespaces
$namespaces = $sxe->getNamespaces(true);
//Register them with their prefixes
foreach ($namespaces as $prefix => $ns) {
$sxe->registerXPathNamespace($prefix, $ns);
}
?>
http://php.net/manual/en/function.simplexml-element-registerXPathNamespace.php