ID: 46199 User updated by: josef dot buk at volny dot cz Reported By: josef dot buk at volny dot cz -Status: Feedback +Status: Open Bug Type: *XML functions Operating System: Win XP Pro SP3 PHP Version: 5.2.6 New Comment:
Hi. I apologize. url=http://cz2.php.net/manual/en/function.xml-parse.php The first example - the definition of xx_xml class. Copy it and add the lines I mentioned: <?php ... copy class xx_xml { ... } ... $xml=new xx_xml("<aa>aaa1<bb databb='xbxb'>bbbb1</bb>aaa2<cc>ccc1</cc>aaaa3</aa>","contents"); print_r($xml->data); ?> You get the result I wrote. The problem is, that the text aaa2 and aaa3 are placed wrongly to [aa|bb] resp. [aa|cc] sections. Josef Previous Comments: ------------------------------------------------------------------------ [2008-09-30 09:08:53] [EMAIL PROTECTED] I must be missing something, but "There is an error in the first example from 24-May-2008 05:30." points to some kind of example... Where would this example be exactly? The documentation? If so, could you give us the URL you found it at ? ------------------------------------------------------------------------ [2008-09-29 19:37:18] josef dot buk at volny dot cz Description: ------------ There is an error in the first example from 24-May-2008 05:30. The result gives: Reproduce code: --------------- Try this: just a copy of the class definition and $xml=new xx_xml("<aa>aaa1<bb databb='xbxb'>bbbb1</bb>aaa2<cc>ccc1</cc>aaaa3</aa>","contents"); print_r($xml->data); Expected result: ---------------- Array ( [aa] => Array ( [data] => Array ( [0] => aaa1 [1] => aaa2 [2] => aaa3 ) ) [aa|bb] => Array ( [databb] => xbxb [data] => Array ( [0] => bbbb1 ) ) [aa|cc] => Array ( [data] => Array ( [0] => ccc1 ) ) Actual result: -------------- Array ( [aa] => Array ( [data] => Array ( [0] => aaa1 ) ) [aa|bb] => Array ( [databb] => xbxb [data] => Array ( [0] => bbbb1 [1] => aaa2 ) ) [aa|cc] => Array ( [data] => Array ( [0] => ccc1aaaa3 ) ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46199&edit=1