#46199 [Opn->Bgs]: Bug in xml_parser example

From: Date: Sun, 05 Oct 2008 04:13:05 +0000
Subject: #46199 [Opn->Bgs]: Bug in xml_parser example
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-1188@lists.php.net to get a copy of this message
ID: 46199 Updated by: kalle@php.net Reported By: josef dot buk at volny dot cz -Status: Open +Status: Bogus Bug Type: Documentation problem Operating System: Win XP Pro SP3 PHP Version: 5.2.6 -Assigned To: +Assigned To: kalle New Comment: Bogus, this is a user comment and not an actual documentation issue :) Previous Comments: ------------------------------------------------------------------------ [2008-09-30 18:48:51] josef dot buk at volny dot cz 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 ------------------------------------------------------------------------ [2008-09-30 09:08:53] tularis@php.net 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

« previous php.doc.bugs (#1188) next »