I have a big problem with PHP DOMDocument :: validate (), which seems to systematically ask DTD.
This is a big problem when I want to check, for example, an XHTML document as described here .
Since w3.org seems to reject the entire request from the PHP server, it is not possible to validate my document using this method ...
Is there any solution for this?
thanks in advance
[EDIT] The following are some guidelines:
/var/www/test.php:
<?php $implementation = new DOMImplementation(); $dtd = $implementation->createDocumentType ( 'html', // qualifiedName '-//W3C//DTD XHTML 1.0 Transitional//EN', // publicId 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-' .'transitional.dtd' // systemId ); $document = $implementation->createDocument('', '', $dtd); $document->validate();
[ http: //] 127.0.0.1/test.php :
Warning: DOMDocument::validate(http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /var/www/test.php on line 14 Warning: DOMDocument::validate(): I/O warning : failed to load external entity "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" in /var/www/test.php on line 14 Warning: DOMDocument::validate(): Could not load the external subset "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" in /var/www/test.php on line 14
Related questions:
- How to import XML string in php
DOMDocument ? (solved)
xml php xhtml domdocument
Pascal qyy
source share