Annotation of embedaddon/php/ext/simplexml/tests/023.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: SimpleXML: Attributes with entities
3: --SKIPIF--
4: <?php if (!extension_loaded("simplexml")) print "skip"; ?>
5: --FILE--
6: <?php
7:
8: $xml =<<<EOF
9: <?xml version='1.0'?>
10: <!DOCTYPE talks SYSTEM "nbsp.dtd" [
11: <!ELEMENT root EMPTY>
12: <!ATTLIST root attr1 CDATA #IMPLIED>
13: <!ENTITY nbsp "&#x00A0;">
14: ]>
15: <root attr='foo bar baz'></root>
16: EOF;
17:
18: $sxe = simplexml_load_string($xml);
19:
20: var_dump($sxe);
21: var_dump($sxe['attr']);
22: ?>
23: ===DONE===
24: --EXPECTF--
25: object(SimpleXMLElement)#%d (1) {
26: ["@attributes"]=>
27: array(1) {
28: ["attr"]=>
29: string(%d) "foo%sbar%sbaz"
30: }
31: }
32: object(SimpleXMLElement)#%d (1) {
33: [0]=>
34: string(%d) "foo%sbar%sbaz"
35: }
36: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>