protected function XmlFileLoader::validate

Same name in this branch

Validates a loaded XML file.

Parameters

\DOMDocument $dom A loaded XML file:

Throws

\InvalidArgumentException When XML doesn't validate its XSD schema

1 call to XmlFileLoader::validate()
XmlFileLoader::loadFile in drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/XmlFileLoader.php
Loads an XML file.
1 method overrides XmlFileLoader::validate()
CustomXmlFileLoader::validate in drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/CustomXmlFileLoader.php
Validates a loaded XML file.

File

drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/XmlFileLoader.php, line 207

Class

XmlFileLoader
XmlFileLoader loads XML routing files.

Namespace

Symfony\Component\Routing\Loader

Code

protected function validate(\DOMDocument $dom) {
  $location = __DIR__ . '/schema/routing/routing-1.0.xsd';
  $current = libxml_use_internal_errors(true);
  libxml_clear_errors();
  if (!$dom
    ->schemaValidate($location)) {
    throw new \InvalidArgumentException(implode("\n", $this
      ->getXmlErrors($current)));
  }
  libxml_use_internal_errors($current);
}