/* if anything goes wrong you can get all errors at once */ $allErrors = libxml_get_errors(); /* each element of the array $allErrors will be a LibXmlError Object */ print_r($allErrors); print "<h2>Validation was incorrect</h2>"; } else { print "<h2>Validation was finished correctly</h2>"; } require_once "../../../../sources/models/Schematron.php"; $s = new Schematron(); //$fp=fopen("validation_sample1.xml","r"); $fp = fopen("ARQuery_check.sch", "r"); $uncompiled = fread($fp, filesize("ARQuery_check.sch")); fclose($fp); //$fp=fopen("sample1.xml","r"); //$fp = fopen("ARQuery-Sample.xml", "r"); //$xml = fread($fp, filesize("ARQuery-Sample.xml")); //fclose($fp); /* Uncompiled tests */ print "<h3>Schematron Test</h3>"; /* MEM USING MEM */ $ret = $s->schematronValidate($xmlFileFinal, $uncompiled); print "<textarea rows='10' cols='100'>{$ret}</textarea>"; $filePath = "ARQuery-Sample.xml"; $file = fopen($filePath, "r"); $expectedResult = fread($file, filesize($filePath)); if (areXmlSame($xmlFileFinal, $expectedResult)) { print "<h2>XML file is as expected</h2>"; } else { print "<h2>XML file is NOT as expected</h2>"; }