I am walidating my XML with a DTD file I have locally.
For that, I am doing:
$xml = $dmsMerrin.'/xml/'.$id.'/conversion.xml';
$dtd = $dmsMerrin.'/style_files/journalpublishing.dtd';
$dom = new DOMDocument();
@$dom->load($xml);
libxml_use_internal_errors(true);
if (@$dom->validate()) {
$htmlDTDError .= "<h2>No Errors Found - The tested file is Valid !</h2>";
}
else {
$errors = libxml_get_errors();
$htmlDTDError .= '<h2>Errors Found ('.count($errors).')</h2><ol>';
foreach ($errors as $error) {
$htmlDTDError .= '<li>'.$error->message.' on line '.$error->line. '</li>';
}
$htmlDTDError .= '</ol>';
libxml_clear_errors();
}
libxml_use_internal_errors(false);
And this takes about 30sec for an XML with 1600 lines.
Is this a usual time? Should be much faster in my opinion?
As you can see, the DTD I am using is locally on the server.
Any idea? Thank you.
EDIT: By debuging and checking the execution time, I noticed that it takes the same time if my xml has 1600 lines or 150 lines, so the problem is not the xml size.
$dmsMerrin
afile:/
URL? – Sices