Bug #60027 [Opn]: DOMDocument::schemaValidate
| From: | richard at organicdata dot co dot za | Date: | Tue, 11 Oct 2011 18:36:23 +0000 |
| Subject: | Bug #60027 [Opn]: DOMDocument::schemaValidate | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-164236@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60027&edit=1
ID: 60027
User updated by: richard at organicdata dot co dot za
Reported by: richard at organicdata dot co dot za
Summary: DOMDocument::schemaValidate
Status: Open
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:
ah since I see the last comment immediately I can only assume that the site doesn't handle
pasted xml comments. Is there any way I can upload the example file or is there some other preferred
method of file submission?
thanks again
Previous Comments:
------------------------------------------------------------------------
[2011-10-11 18:34:11] richard at organicdata dot co dot za
Hi,
I have no idea whether the file I submitted yesterday has been received as this site doesn't
confirm comment submission that I could see; the comments section has not been updated and I have
received no emails.
If someone could please confirm that the file has been received I would appreciate as this
functionality lack is both critical and urgent for us.
thanks very much
------------------------------------------------------------------------
[2011-10-10 09:45:10] cataphract@php.net
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.
------------------------------------------------------------------------
[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