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