private function loadXml(\core_kernel_classes_Resource $item)
    {
        $itemService = Service::singleton();

        try {
            $xml = $itemService->getXmlByRdfItem($item);
            if (empty($xml)) {
                throw new ExtractorException('No content found for item ' . $item->getUri());
            }
        } catch (FileNotFoundException $e) {
            throw new ExtractorException('qti.xml file was not found for item '. $item->getUri() .'; The item might be empty.');
        }

        $this->dom   = new \DOMDocument();
        $this->dom->loadXml($xml);
        $this->xpath = new \DOMXpath($this->dom);
        $this->xpath->registerNamespace('qti', $this->dom->documentElement->namespaceURI);

        return $this;
    }
private function loadXml(\core_kernel_classes_Resource $item)
    {
        $itemService = Service::singleton();

        try {
            $xml = $itemService->getXmlByRdfItem($item);
            if (empty($xml)) {
                throw new ExtractorException('No content found for item ' . $item->getUri());
            }
        } catch (FileNotFoundException $e) {
            throw new ExtractorException('qti.xml file was not found for item '. $item->getUri() .'; The item might be empty.');
        }

        $this->dom   = new \DOMDocument();
        $this->dom->loadXml($xml);
        $this->xpath = new \DOMXpath($this->dom);
        $this->xpath->registerNamespace('qti', $this->dom->documentElement->namespaceURI);

        return $this;
    }
private function loadXml ( \ core_kernel_classes_Resource $ item ) { $ itemService = Service :: singleton ( ) ; try { $ xml = $ itemService -> getXmlByRdfItem ( $ item ) ; if ( empty ( $ xml ) ) { throw new ExtractorException ( 'No content found for item ' . $ item -> getUri ( ) ) ; } } catch ( FileNotFoundException $ e ) { throw new ExtractorException ( 'qti.xml file was not found for item ' . $ item -> getUri ( ) . '; The item might be empty.' ) ; } $ this -> dom = new \ DOMDocument ( ) ; $ this -> dom -> loadXml ( $ xml ) ; $ this -> xpath = new \ DOMXpath ( $ this -> dom ) ; $ this -> xpath -> registerNamespace ( 'qti' , $ this -> dom -> documentElement -> namespaceURI ) ; return $ this ; }
Load Dom & Xpath of xml item content & register xpath namespace

@param \core_kernel_classes_Resource $item
@return $this
@throws ExtractorException
Load Dom & Xpath of xml item content & register xpath namespace