php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60027 DOMDocument::schemaValidate
Submitted: 2011-10-10 08:43 UTC Modified: 2011-10-16 08:16 UTC
From: richard at organicdata dot co dot za Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 5.3.8 OS: Centos 5.5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: richard at organicdata dot co dot za
New email:
PHP Version: OS:

 

 [2011-10-10 08:43 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-10-10 09:45 UTC] cataphract@php.net
-Status: Open +Status: Feedback
 [2011-10-10 09:45 UTC] 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-11 18:34 UTC] richard at organicdata dot co dot za
-Status: Feedback +Status: Open
 [2011-10-11 18:34 UTC] 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-11 18:36 UTC] richard at organicdata dot co dot za
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
 [2011-10-11 18:54 UTC] richard at organicdata dot co dot za
hi i'm out of ideas - I htmlencoded the example xml file and submitted and I get this message

ERROR:

    Please do not SPAM our bug system.

please can someone help me with ideas as to how to submit the xml file requested

thanks!
 [2011-10-11 22:22 UTC] felipe@php.net
The bug tracker just allows the following mime-types:
application/x-txt, text/plain, text/x-diff, text/x-patch, text/x-c++, text/x-c, text/x-m4 and cannot be larger than 100k.
 [2011-10-13 06:49 UTC] richard at organicdata dot co dot za
Hello

I'm afraid the below isn't clear for me. Please can we keep this simple. All I need is either:
1. to be told how to upload the tiny XML file that has been requested by "cataphract at php.net"; or
2. for Felipe to confirm that he has received the XML file and for him to provide it to the appropriate person; as I have sent it to his email address "felipe at php.net" 

could someone please help here so this can move forward and hopefully be resolved as soon as possible.

thank you
 [2011-10-14 09:16 UTC] richard at organicdata dot co dot za
I'm becoming very concerned at the apparent lack of positive interest in this issue from the PHP team.

Even the risk of inability to validate one of the world's most used document formats should in my opinion be high on PHPs agenda - and if it indeed is a problem under xmllint then the PHP team should be pushing xmllint to sort it out - as ultimately it is PHP that benefits from the functionality.

Just to give you some sense in our case  - this functionality is critical and not being able to use it or get it fixed may be enough to stop our use of PHP - which I would be really sad to see happen as it is a great language in many regards.

I am more than willing to help in any way I can with samples, testing and so on however I am unable to fix this on my own. I do need someone from the team to engage constructively.

If someone could please engage I would really appreciate it.

thanks
 [2011-10-15 12:04 UTC] rrichards@php.net
-Status: Open +Status: Bogus
 [2011-10-15 12:04 UTC] rrichards@php.net
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.

issue in libxml not PHP
 [2011-10-16 08:16 UTC] richard at organicdata dot co dot za
Hello,

thank you for your feedback.

I have verified the xmllint issue "segmentation fault" and opened https://bugzilla.gnome.org/show_bug.cgi?id=661838

I will not update this again but regardless of where the bug lies I would like to note that my concern with this PHP team engagement has been as follows:
1. I was asked by the PHP team to upload an XML file - no file upload mechanism is provided that I can find and the web page does not seem to handle the pasting of the xml file, even if htmlencoded
2. I spent a lot of time trying to achieve the above and asked the PHP team a number of times for help - I received nothing of value from the team

My observation is as follows (this is not intended as criticism but constructively): We are keen followers of PHP and have invested heavily in adoption, however we run a business and our business needs to survive just like any other. We have wasted a lot of time with 0 progress on this bug and we simply can't afford it as a business. In my opinion, the PHP team could significantly improve bug handling abilities by providing a simple file upload utility (as is provided by the gnome site). 

Also, while I understand that this is not a PHP bug, ultimately it does not matter, the problem ultimately affects PHP users (who really don't care about what underpins PHP) - and when it is of such global significance ie. the inability to validate OOXML document structure, I think the PHP team should be lending their weight to ensuring that the problem is understood and if indeed a bug is fixed as fast as possible by the provider - ie. in this case libxml developer/s. 

thanks
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 19:01:33 2024 UTC