Edit report at http://bugs.php.net/bug.php?id=53314&edit=1
ID: 53314 Updated by: fel...@php.net Reported by: 122363686 at qq dot com Summary: simplexml_load_string can't parse all tags -Status: Open +Status: Bogus Type: Bug Package: SimpleXML related Operating System: windows XP PHP Version: 5.3.3 Block user comment: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php This is a known detail when printing the SimpleXMLElement using print_r(). But the element is there. You can check them using: var_dump($xml->xpath('//textEntryInteraction')); There are others reported related to this, e.g. bug #44973 But this is not a PHP bug, thanks. Previous Comments: ------------------------------------------------------------------------ [2010-11-15 07:47:23] 122363686 at qq dot com Description: ------------ run this php,i can't find <textEntryInteraction>9999</textEntryInteraction> & <textEntryInteraction>14285</textEntryInteraction> in the result. Test script: --------------- $string ='<assessmentItem> <item Type="assessmentItem"> <prompt>ä¸å¹¿ç½å¿«è®¯ï¼è®°è å¼ æ£æ£ï¼æ®ä¸å½ä¹å£°ã央广æ°é»ãæ¥éï¼å½å®¶ç»è®¡å±ååå ¬å¸äºææ°æ¶è´¹è ç©ä»·ææ°åç产è ç©ä»·ææ°ã</prompt> </item> <item Type="assessmentItem"> <prompt>0æä»½å± æ°æ¶è´¹ä»·æ ¼ææ°åæ¯ä¸æ¶¨4.4%</prompt> <simpleChoice correctResponse="False">1ï¼æ¶¨å¹ æ¯9æä»½æ©å¤§0.8个ç¾åç¹ã</simpleChoice> <simpleChoice correctResponse="False">å ¶ä¸ï¼åå¸ä¸æ¶¨4.2%ï¼åæä¸æ¶¨4.7%ï¼é£åä»·æ ¼ä¸æ¶¨10.1%</simpleChoice> <simpleChoice correctResponse="True">éé£åä»·æ ¼ä¸æ¶¨1.6%ï¼æ¶è´¹åä»·æ ¼ä¸æ¶¨5%ï¼æå¡é¡¹ç®ä»·æ ¼ä¸æ¶¨2.5%ã</simpleChoice> </item> <item Type="assessmentItem"> <prompt>10æä»½å·¥ä¸ååºåä»·æ ¼åæ¯ä¸æ¶¨5.0%ï¼</prompt> <simpleChoice correctResponse="True"> æ¶¨å¹ æ¯9æä»½æ©å¤§<textEntryInteraction>9999</textEntryInteraction>ç¾åç¹ã </simpleChoice> <simpleChoice correctResponse="False">ãæ¤å¤ï¼ç¤¾ä¼æ¶è´¹åé¶å®æ»é¢ä¿æè¾å¿«å¢é¿ï¼</simpleChoice> <simpleChoice correctResponse="True"> ç¤¾ä¼æ¶è´¹åé¶å®æ»é¢ <textEntryInteraction>14285</textEntryInteraction> 亿å ï¼åæ¯å¢é¿18.6%ï¼æ¯9æä»½åè½0.2个ç¾åç¹ã </simpleChoice> </item> <item Type="assessmentItem"> <prompt>å·¥ä¸ç产平稳å¢é¿ã10æä»½è§æ¨¡ä»¥ä¸å·¥ä¸å¢å å¼åæ¯å¢é¿13.1%ï¼æ¯9æä»½åè½0.2个ç¾åç¹ã1è³10æè§æ¨¡ä»¥ä¸å·¥ä¸å¢å å¼åæ¯å¢é¿16.1%ï¼æ¯1è³9æä»½åè½0.2个ç¾åç¹ã1è³10æåéåºå®èµäº§æèµ187556亿å ï¼åæ¯å¢é¿24.4%ï¼1è³9æä»½åè½0.1个ç¾åç¹ã</prompt> <textEntryInteraction/> </item> </assessmentItem> '; $xml = simplexml_load_string($string); echo '<pre>'; print_r($xml); Expected result: ---------------- Please parse all tags. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53314&edit=1