private function loadXml($file)
    {
        $internal = libxml_use_internal_errors(true);

        $doc = new DOMDocument();
        $doc->preserveWhiteSpace = false;
        $doc->validateOnParse = true;

        if (!@$doc->load($file)) {
            $errors = libxml_get_errors();

            libxml_use_internal_errors($internal);

            throw XmlException::createUsingErrors($errors);
        }

        libxml_use_internal_errors($internal);

        return new DOMXPath($doc);
    }
private function loadXml($file)
    {
        $internal = libxml_use_internal_errors(true);

        $doc = new DOMDocument();
        $doc->preserveWhiteSpace = false;
        $doc->validateOnParse = true;

        if (!@$doc->load($file)) {
            $errors = libxml_get_errors();

            libxml_use_internal_errors($internal);

            throw XmlException::createUsingErrors($errors);
        }

        libxml_use_internal_errors($internal);

        return new DOMXPath($doc);
    }
private function loadXml ( $ file ) { $ internal = libxml_use_internal_errors ( true ) ; $ doc = new DOMDocument ( ) ; $ doc -> preserveWhiteSpace = false ; $ doc -> validateOnParse = true ; if ( ! @ $ doc -> load ( $ file ) ) { $ errors = libxml_get_errors ( ) ; libxml_use_internal_errors ( $ internal ) ; throw XmlException :: createUsingErrors ( $ errors ) ; } libxml_use_internal_errors ( $ internal ) ; return new DOMXPath ( $ doc ) ; }
Loads and validates an XML document from a file for querying.

@param string $file The file path.

@return DOMXPath The XPath object for querying.

@throws XmlException If the file could not be loaded.
Loads and validates an XML document from a file for querying .