how to validate a xml file against a xsd? there is domdocument::schemaValidate() but It does not tell where are the errors. is there any class for that? does it have any worth m
This code does the business:
$xml= new DOMDocument();
$xml->loadXML(, LIBXML_NOBLANKS); // Or load if filename required
if (!$xml->schemaValidate()) // Or schemaValidateSource if string used.
{
// You have an error in the XML file
}
See the code in http://php.net/manual/en/domdocument.schemavalidate.php To retrieve the errors.
I.e.
justin at redwiredesign dot com 08-Nov-2006 03:32 post.