Bug #60416 [Opn->Nab]: SimpleXML parse fails because of an URL, no error messages

From: Date: Fri, 26 Jun 2015 17:11:15 +0000
Subject: Bug #60416 [Opn->Nab]: SimpleXML parse fails because of an URL, no error messages
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193920@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60416&edit=1 ID: 60416 Updated by: cmb@php.net Reported by: stigh at funcom dot com Summary: SimpleXML parse fails because of an URL, no error messages -Status: Open +Status: Not a bug Type: Bug Package: SimpleXML related Operating System: CentOS 5 PHP Version: 5.3.8 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. See <http://php.net/manual/en/simplexmlelement.children.php#example-5935>. Previous Comments: ------------------------------------------------------------------------ [2011-11-30 12:31:54] stigh at funcom dot com Description: ------------ - SimpleXML - Revision: 314376 - libxml2 - version: 2.6.26 XML document generated using Word 2007, saving as regular Word file (doxc), then extracting the "word/document.xml" file from the compressed docx file (open w/7-zip, WinZIP, WinRAR, etc.). I've been developing a docx parser in PHP and have encountered a strange bug. SimpleXML fails to parse the XML due to a URL in the XML document. I get no errors even with libxml_use_internal_errors(true) and libxml_get_errors(). the same documents parses perfectly fine with DOMDocument and also the W3C validator. I played around with the XML, trying to add/remove elements causing the parse error, and it turned out to be a URL in the <w:document> node. It is the URL in this line in the w:document tag: xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" Remove the URL, keeping xmlns:w="" makes the parse successful. Test script: --------------- Script for reproduction: http://nerdvar.com/stigma/php_src/simplexml_bug_example.phps The entire document.xml file: http://nerdvar.com/stigma/php_src/document.xml Expected result: ---------------- SimpleXMLElement Object ( [body] => SimpleXMLElement Object ( [0] => ) ) Actual result: -------------- Error ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60416&edit=1

« previous php.bugs (#193920) next »