Hello
I have a big problem with the PHP DOMDocument::validate() who seems to ask the DTD systematically.
It is a big problem when I whant to validate, for example, an XHTML document as explained here.
As w3.org seems to reject all request from a PHP server, it's impossible to validate my document with this method...
Is there any solution for that ?
Thanks by advance
[EDIT] Here is some precisions :
/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 question :