Validation XSD

Schema XSD : labels.xsd


Votre fichier labels.xml :



GetSummary()[0]; libxml_use_internal_errors(true); $myDocument = new DomDocument(); if (!$myDocument->load($file)) die('Error Loading Document'); if (!$myDocument->schemaValidate("labels.xsd")) { //$errors = libxml_get_last_error(); $errors = libxml_get_errors (); //echo('Error Parsing Document :
'); $NewErrors = array(); $temp = array(); for ($i=0; $i$errors[$i]->code, 'line'=>$errors[$i]->line, 'column'=>$errors[$i]->column, 'message'=>str_replace ("{http://lriaudel.free.fr/}", "mad:", $errors[$i]->message)); array_push($NewErrors, $temp); } pArray($NewErrors); } else{ pArray("XML file OK"); } session_destroy(); } ?>