Edit report at https://bugs.php.net/bug.php?id=60027&edit=1
ID: 60027 Updated by: cataphr...@php.net Reported by: richard at organicdata dot co dot za Summary: DOMDocument::schemaValidate -Status: Open +Status: Feedback Type: Bug Package: DOM XML related Operating System: Centos 5.5 PHP Version: 5.3.8 Block user comment: N Private report: N New Comment: If there's a bug here, it's probably in libxml2 and not in PHP, but in any case: * Try with xmlint. If it works, it's likely a PHP problem. * Post an example XML file so that we can run the script. Previous Comments: ------------------------------------------------------------------------ [2011-10-10 08:43:39] richard at organicdata dot co dot za Description: ------------ I'm using the Zend Server 5.5 Community Edition stack on Centos 5 I'm not sure where exactly this should be posted but I believe it is a bug in the DOMDocument::schemaValidate method. I am trying to use DOMDocument::schemaValidate to validate a word docx document using the ECMA-376 3rd edition Part 4 transitional schema http://www.ecma-international.org/publi ... ma-376.htm I have Word docx document validation working 100% with these schema files using XMLspy 2007 and XMspy 2011 and I thought it would be a simple matter to achieve the same via PHP. After making a few extremely minor schema amendments to fix few things about the schema that PHP doesn't appear to like (eg. I needed to set a local location for xml.xsd to ensure that xml:space was properly interpreted), I have reached a point where DOMDocument::schemaValidate simply does nothing - it doesn't succeed, it doesn't fail and it doesn't throw error. For a simple illustration please see the following code - no php errors are thrown and neither of the 2 print statements are executed - essentially the application appears to "hang" I have also included libxml_use_internal_errors(true) related code and no errors are provided back. Finally I have searched the web thoroughly to see whether anyone has experienced the same / similar problem however I am unable to find anything tangible. Test script: --------------- $xsdFile = "wml.xsd"; $tst = new DOMDocument('1.0','UTF-8'); // create a new DOM document $tst->preserveWhiteSpace = true; $tst->load(G_DEBUGDATA_PATH . "docx_document.xml"); if (!$tst->schemaValidate($xsdFile)) { print "Failed"; } else { // schema validated successfully print "succeeded"; } Expected result: ---------------- Either success or failure - and some form of error message provided Actual result: -------------- nothing at all ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60027&edit=1