li3_cldr\extensions\adapter\g11n\catalog\Cldr::_parseXml()

protected method

Parses a XML file and retrieves data from it using an XPATH query and a given closure.

If possible will activate small nodes allocation optimization when interfacing with libxml. Some options are available only when using libxml with version >= 2.6.21.

Parameters

  • string $file

    Absolute path to the XML file.

  • string $query

    An XPATH query to select items.

Returns

array

Source

	protected function _parseXml($file, $query) {
		if (!file_exists($file)) {
			return array();
		}
		$options = defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0;

		$document = new SimpleXmlElement($file, $options, true);
		return $document->xpath($query);
	}