private function validateWithSchema(DOMDocument $document): void
    {
        $validationErrors = [];
        set_error_handler(function (/** @noinspection PhpUnusedParameterInspection */ $errno, $errstr)
 use (&$validationErrors) {
            array_push($validationErrors, $errstr);
        });

        $isValid = $document->schemaValidate(Constant::$XSD_SCHEMA_PATH);
        restore_error_handler();

        if (!$isValid) {
            throw new XMLSchemaViolationException($validationErrors);
        }
    }
private function validateWithSchema(DOMDocument $document): void
    {
        $validationErrors = [];
        set_error_handler(function (/** @noinspection PhpUnusedParameterInspection */ $errno, $errstr)
 use (&$validationErrors) {
            array_push($validationErrors, $errstr);
        });

        $isValid = $document->schemaValidate(Constant::$XSD_SCHEMA_PATH);
        restore_error_handler();

        if (!$isValid) {
            throw new XMLSchemaViolationException($validationErrors);
        }
    }
private function validateWithSchema ( DOMDocument $ document ) : void { $ validationErrors = [ ] ; set_error_handler ( function ( /** @noinspection PhpUnusedParameterInspection */ $ errno , $ errstr ) use ( & $ validationErrors ) { array_push ( $ validationErrors , $ errstr ) ; } ) ; $ isValid = $ document -> schemaValidate ( Constant :: $ XSD_SCHEMA_PATH ) ; restore_error_handler ( ) ; if ( ! $ isValid ) { throw new XMLSchemaViolationException ( $ validationErrors ) ; } }
Validates the export page against the schema. In case of violations, an exception is thrown.

@param DOMDocument $document The document to validate.
Validates the export page against the schema . In case of violations an exception is thrown .