validate() public method

Handles ISO Schematron (as XSLT stylesheet), XSD and RELAX NG schemas.
public validate ( DOMDocument $document ) : string[]
$document DOMDocument
return string[] An array of validation errors
 function convert($xmlString)
 {
     $inputDocument = $this->createDocument($xmlString);
     $this->removeComments($inputDocument);
     $convertedDocument = $this->converter->convert($inputDocument);
     // Needed by some disabled output escaping (eg. legacy ezxml paragraph <line/> elements)
     $convertedDocumentNormalized = new DOMDocument();
     $convertedDocumentNormalized->loadXML($convertedDocument->saveXML());
     $errors = $this->validator->validate($convertedDocument);
     $result = $convertedDocumentNormalized->saveXML();
     if (!empty($errors)) {
         $this->logger->error("Validation errors when converting xmlstring", ['result' => $result, 'errors' => $errors, 'xmlString' => $xmlString]);
     }
     return $result;
 }