You are here

protected function XmlFileLoader::parseNode in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/routing/Loader/XmlFileLoader.php \Symfony\Component\Routing\Loader\XmlFileLoader::parseNode()

Parses a node from a loaded XML file.

Parameters

RouteCollection $collection Collection to associate with the node:

\DOMElement $node Element to parse:

string $path Full path of the XML file being processed:

string $file Loaded file name:

Throws

\InvalidArgumentException When the XML is invalid

1 call to XmlFileLoader::parseNode()
XmlFileLoader::load in vendor/symfony/routing/Loader/XmlFileLoader.php
Loads an XML file.

File

vendor/symfony/routing/Loader/XmlFileLoader.php, line 73

Class

XmlFileLoader
XmlFileLoader loads XML routing files.

Namespace

Symfony\Component\Routing\Loader

Code

protected function parseNode(RouteCollection $collection, \DOMElement $node, $path, $file) {
  if (self::NAMESPACE_URI !== $node->namespaceURI) {
    return;
  }
  switch ($node->localName) {
    case 'route':
      $this
        ->parseRoute($collection, $node, $path);
      break;
    case 'import':
      $this
        ->parseImport($collection, $node, $path, $file);
      break;
    default:
      throw new \InvalidArgumentException(sprintf('Unknown tag "%s" used in file "%s". Expected "route" or "import".', $node->localName, $path));
  }
}