You are here

private function XmlFileLoader::parseFile in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/validator/Mapping/Loader/XmlFileLoader.php \Symfony\Component\Validator\Mapping\Loader\XmlFileLoader::parseFile()
  2. 8 vendor/symfony/serializer/Mapping/Loader/XmlFileLoader.php \Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader::parseFile()
Same name and namespace in other branches
  1. 8.0 vendor/symfony/serializer/Mapping/Loader/XmlFileLoader.php \Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader::parseFile()

Parses a XML File.

Parameters

string $file Path of file:

Return value

\SimpleXMLElement

Throws

MappingException

1 call to XmlFileLoader::parseFile()
XmlFileLoader::loadClassMetadata in vendor/symfony/serializer/Mapping/Loader/XmlFileLoader.php
Load class metadata.

File

vendor/symfony/serializer/Mapping/Loader/XmlFileLoader.php, line 82

Class

XmlFileLoader
Loads XML mapping files.

Namespace

Symfony\Component\Serializer\Mapping\Loader

Code

private function parseFile($file) {
  try {
    $dom = XmlUtils::loadFile($file, __DIR__ . '/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd');
  } catch (\Exception $e) {
    throw new MappingException($e
      ->getMessage(), $e
      ->getCode(), $e);
  }
  return simplexml_import_dom($dom);
}