Sulu\Bundle\MediaBundle\Media\FormatLoader\BaseXmlFormatLoader::parseXml PHP Method

parseXml() private method

private parseXml ( $file ) : array
$file
return array
    private function parseXml($file)
    {
        $formats = [];
        // load xml file
        $xmlDoc = $this->tryLoad($file);
        $this->xpath = new \DOMXPath($xmlDoc);
        $this->xpath->registerNamespace('x', static::XML_NAMESPACE_URI);
        foreach ($this->xpath->query('/x:formats/x:format') as $formatNode) {
            $this->addFormatFromFormatNode($formatNode, $formats);
        }
        return $formats;
    }