Bug #60027 [NEW]: DOMDocument::schemaValidate
| From: | richard at organicdata dot co dot za | Date: | Mon, 10 Oct 2011 08:43:39 +0000 |
| Subject: | Bug #60027 [NEW]: DOMDocument::schemaValidate | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-164202@lists.php.net to get a copy of this message | ||
From:
Operating system: Centos 5.5
PHP version: 5.3.8
Package: DOM XML related
Bug Type: Bug
Bug description:DOMDocument::schemaValidate
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 bug report at https://bugs.php.net/bug.php?id=60027&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60027&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60027&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60027&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=60027&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60027&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=60027&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=60027&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=60027&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=60027&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=60027&r=support
Expected behavior: https://bugs.php.net/fix.php?id=60027&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=60027&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=60027&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=60027&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60027&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=60027&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=60027&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=60027&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=60027&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=60027&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=60027&r=mysqlcfg