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 => $validator) {
            if ($documentNamespace === $namespace) {
                if ($validator === null) {
                    return array();
                }

                return $validator->validate($document);
            }
        }

        throw new NotFoundException('Validator', $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 => $validator) {
            if ($documentNamespace === $namespace) {
                if ($validator === null) {
                    return array();
                }

                return $validator->validate($document);
            }
        }

        throw new NotFoundException('Validator', $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 => $ validator ) { if ( $ documentNamespace === $ namespace ) { if ( $ validator === null ) { return array ( ) ; } return $ validator -> validate ( $ document ) ; } } throw new NotFoundException ( 'Validator' , $ documentNamespace ) ; }
Dispatches DOMDocument to the namespace mapped validator.

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

@param \DOMDocument $document

@return string[]
Dispatches DOMDocument to the namespace mapped validator .