1--TEST--
2Test xml_parse_into_struct() function : variation
3--SKIPIF--
4<?php
5if (!extension_loaded("xml")) {
6    print "skip - XML extension not loaded";
7}
8?>
9--FILE--
10<?php
11echo "*** Testing xml_parse_into_struct() : variation ***\n";
12
13$simple = "<main><para><note>simple note</note></para><para><note>simple note</note></para></main>";
14$p = xml_parser_create();
15xml_parse_into_struct($p, $simple, $vals, $index);
16xml_parser_free($p);
17echo "Index array\n";
18print_r($index);
19echo "\nVals array\n";
20print_r($vals);
21
22
23echo "Done";
24?>
25--EXPECT--
26*** Testing xml_parse_into_struct() : variation ***
27Index array
28Array
29(
30    [MAIN] => Array
31        (
32            [0] => 0
33            [1] => 7
34        )
35
36    [PARA] => Array
37        (
38            [0] => 1
39            [1] => 3
40            [2] => 4
41            [3] => 6
42        )
43
44    [NOTE] => Array
45        (
46            [0] => 2
47            [1] => 5
48        )
49
50)
51
52Vals array
53Array
54(
55    [0] => Array
56        (
57            [tag] => MAIN
58            [type] => open
59            [level] => 1
60        )
61
62    [1] => Array
63        (
64            [tag] => PARA
65            [type] => open
66            [level] => 2
67        )
68
69    [2] => Array
70        (
71            [tag] => NOTE
72            [type] => complete
73            [level] => 3
74            [value] => simple note
75        )
76
77    [3] => Array
78        (
79            [tag] => PARA
80            [type] => close
81            [level] => 2
82        )
83
84    [4] => Array
85        (
86            [tag] => PARA
87            [type] => open
88            [level] => 2
89        )
90
91    [5] => Array
92        (
93            [tag] => NOTE
94            [type] => complete
95            [level] => 3
96            [value] => simple note
97        )
98
99    [6] => Array
100        (
101            [tag] => PARA
102            [type] => close
103            [level] => 2
104        )
105
106    [7] => Array
107        (
108            [tag] => MAIN
109            [type] => close
110            [level] => 1
111        )
112
113)
114Done
115