xref: /PHP-5.3/ext/xml/tests/xml007.phpt (revision d0c535d0)
1--TEST--
2xml_parse_into_struct/umlauts in tags
3--SKIPIF--
4<?php // vim600: syn=php
5include("skipif.inc");
6if(strtoupper("����") != "����")
7{
8	die("skip strtoupper on non-ascii not supported on this platform");
9}
10?>
11--FILE--
12<?php
13function startHandler($parser,$tag,$attr)
14{
15	var_dump($tag,$attr);
16}
17
18function endHandler($parser,$tag)
19{
20	var_dump($tag);
21}
22
23$xmldata = '<?xml version="1.0" encoding="ISO-8859-1"?><��� ���="���">���</���>';
24$parser = xml_parser_create('ISO-8859-1');
25xml_set_element_handler($parser, "startHandler", "endHandler");
26xml_parse_into_struct($parser, $xmldata, $struct, $index);
27var_dump($struct);
28?>
29--EXPECT--
30string(3) "���"
31array(1) {
32  ["���"]=>
33  string(3) "���"
34}
35string(3) "���"
36array(1) {
37  [0]=>
38  array(5) {
39    ["tag"]=>
40    string(3) "���"
41    ["type"]=>
42    string(8) "complete"
43    ["level"]=>
44    int(1)
45    ["attributes"]=>
46    array(1) {
47      ["���"]=>
48      string(3) "���"
49    }
50    ["value"]=>
51    string(3) "���"
52  }
53}
54