public function dispatch(DOMDocument $document)
    {
        $documentNamespace = $document->documentElement->lookupNamespaceURI(null);
        // checking for null as ezxml has no default namespace...
        if ($documentNamespace === null) {
            $documentNamespace = $document->documentElement->lookupNamespaceURI('xhtml');
        }

        foreach ($this->mapping as $namespace => $converter) {
            if ($documentNamespace === $namespace) {
                if ($converter === null) {
                    return $document;
                }

                return $converter->convert($document);
            }
        }

        throw new NotFoundException('Converter', $documentNamespace);
    }
public function dispatch(DOMDocument $document)
    {
        $documentNamespace = $document->documentElement->lookupNamespaceURI(null);
        // checking for null as ezxml has no default namespace...
        if ($documentNamespace === null) {
            $documentNamespace = $document->documentElement->lookupNamespaceURI('xhtml');
        }

        foreach ($this->mapping as $namespace => $converter) {
            if ($documentNamespace === $namespace) {
                if ($converter === null) {
                    return $document;
                }

                return $converter->convert($document);
            }
        }

        throw new NotFoundException('Converter', $documentNamespace);
    }
public function dispatch ( DOMDocument $ document ) { $ documentNamespace = $ document -> documentElement -> lookupNamespaceURI ( null ) ; // checking for null as ezxml has no default namespace... if ( $ documentNamespace === null ) { $ documentNamespace = $ document -> documentElement -> lookupNamespaceURI ( 'xhtml' ) ; } foreach ( $ this -> mapping as $ namespace => $ converter ) { if ( $ documentNamespace === $ namespace ) { if ( $ converter === null ) { return $ document ; } return $ converter -> convert ( $ document ) ; } } throw new NotFoundException ( 'Converter' , $ documentNamespace ) ; }
Dispatches DOMDocument to the namespace mapped converter.

@throws \eZ\Publish\API\Repository\Exceptions\NotFoundException

@param \DOMDocument $document

@return \DOMDocument
Dispatches DOMDocument to the namespace mapped converter .