2
SimpleXML [profile]: Accessing two elements with the same name, but different namespaces
4
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
7
error_reporting(E_ALL & ~E_NOTICE);
8
$root = simplexml_load_string('<?xml version="1.0"?>
9
<root xmlns:reserved="reserved-ns" xmlns:special="special-ns">
10
<reserved:child>Hello</reserved:child>
11
<special:child>World</special:child>
15
echo $root->children('reserved-ns')->child;
17
echo $root->children('special-ns')->child;
18
foreach ($root->child as $child) {
21
echo "\n---Done---\n";