xref: /PHP-5.3/ext/simplexml/tests/profile10.phpt (revision a4c2f317)
1--TEST--
2SimpleXML [profile]: Accessing two attributes with the same name, but different namespaces
3--SKIPIF--
4<?php if (!extension_loaded("simplexml")) print "skip"; ?>
5--FILE--
6<?php
7error_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 <child reserved:attribute="Sample" special:attribute="Test" />
11</root>
12');
13
14$rsattr = $root->child->attributes('reserved-ns');
15$spattr = $root->child->attributes('special-ns');
16
17echo $rsattr['attribute'];
18echo "\n";
19echo $spattr['attribute'];
20echo "\n---Done---\n";
21?>
22--EXPECT--
23Sample
24Test
25---Done---
26