forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxml007.phpt
53 lines (51 loc) · 969 Bytes
/
xml007.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
--TEST--
xml_parse_into_struct/umlauts in tags
--SKIPIF--
<?php // vim600: syn=php
include("skipif.inc");
if(strtoupper("äöüß") != "ÄÖÜß")
{
die("skip strtoupper on non-ascii not supported on this platform");
}
?>
--FILE--
<?php
function startHandler($parser,$tag,$attr)
{
var_dump($tag,$attr);
}
function endHandler($parser,$tag)
{
var_dump($tag);
}
$xmldata = '<?xml version="1.0" encoding="ISO-8859-1"?><äöü üäß="Üäß">ÄÖÜ</äöü>';
$parser = xml_parser_create('ISO-8859-1');
xml_set_element_handler($parser, "startHandler", "endHandler");
xml_parse_into_struct($parser, $xmldata, $struct, $index);
var_dump($struct);
?>
--EXPECT--
string(3) "ÄÖÜ"
array(1) {
["ÜÄß"]=>
string(3) "Üäß"
}
string(3) "ÄÖÜ"
array(1) {
[0]=>
array(5) {
["tag"]=>
string(3) "ÄÖÜ"
["type"]=>
string(8) "complete"
["level"]=>
int(1)
["attributes"]=>
array(1) {
["ÜÄß"]=>
string(3) "Üäß"
}
["value"]=>
string(3) "ÄÖÜ"
}
}