public static function validateSchema(\DOMDocument $dom): array
    {
        $xliffVersion = static::getVersionNumber($dom);
        $internalErrors = libxml_use_internal_errors(true);
        $disableEntities = libxml_disable_entity_loader(false);

        $isValid = @$dom->schemaValidateSource(self::getSchema($xliffVersion));
        if (!$isValid) {
            libxml_disable_entity_loader($disableEntities);

            return self::getXmlErrors($internalErrors);
        }

        libxml_disable_entity_loader($disableEntities);

        $dom->normalizeDocument();

        libxml_clear_errors();
        libxml_use_internal_errors($internalErrors);

        return [];
    }
public static function validateSchema(\DOMDocument $dom): array
    {
        $xliffVersion = static::getVersionNumber($dom);
        $internalErrors = libxml_use_internal_errors(true);
        $disableEntities = libxml_disable_entity_loader(false);

        $isValid = @$dom->schemaValidateSource(self::getSchema($xliffVersion));
        if (!$isValid) {
            libxml_disable_entity_loader($disableEntities);

            return self::getXmlErrors($internalErrors);
        }

        libxml_disable_entity_loader($disableEntities);

        $dom->normalizeDocument();

        libxml_clear_errors();
        libxml_use_internal_errors($internalErrors);

        return [];
    }
public static function validateSchema ( \ DOMDocument $ dom ) : array { $ xliffVersion = static :: getVersionNumber ( $ dom ) ; $ internalErrors = libxml_use_internal_errors ( true ) ; $ disableEntities = libxml_disable_entity_loader ( false ) ; $ isValid = @ $ dom -> schemaValidateSource ( self :: getSchema ( $ xliffVersion ) ) ; if ( ! $ isValid ) { libxml_disable_entity_loader ( $ disableEntities ) ; return self :: getXmlErrors ( $ internalErrors ) ; } libxml_disable_entity_loader ( $ disableEntities ) ; $ dom -> normalizeDocument ( ) ; libxml_clear_errors ( ) ; libxml_use_internal_errors ( $ internalErrors ) ; return [ ] ; }
Validates and parses the given file into a DOMDocument.

@throws InvalidResourceException
Validates and parses the given file into a DOMDocument .