src/PowerTools/HTML5/Serializer/OutputRules.php
protected function namespaceAttrs($ele) {
        if (!$this->xpath || $this->xpath->document !== $ele->ownerDocument) {
            $this->xpath = new \DOMXPath($ele->ownerDocument);
        }

        foreach ($this->xpath->query('namespace::*[not(.=../../namespace::*)]', $ele) as $nsNode) {
            if (!in_array($nsNode->nodeValue, $this->implicitNamespaces)) {
                $this->wr(' ')->wr($nsNode->nodeName)->wr('="')->wr($nsNode->nodeValue)->wr('"');
            }
        }
    }
protected function namespaceAttrs($ele) {
        if (!$this->xpath || $this->xpath->document !== $ele->ownerDocument) {
            $this->xpath = new \DOMXPath($ele->ownerDocument);
        }

        foreach ($this->xpath->query('namespace::*[not(.=../../namespace::*)]', $ele) as $nsNode) {
            if (!in_array($nsNode->nodeValue, $this->implicitNamespaces)) {
                $this->wr(' ')->wr($nsNode->nodeName)->wr('="')->wr($nsNode->nodeValue)->wr('"');
            }
        }
    }
protected function namespaceAttrs ( $ ele ) { if ( ! $ this -> xpath || $ this -> xpath -> document !== $ ele -> ownerDocument ) { $ this -> xpath = new \ DOMXPath ( $ ele -> ownerDocument ) ; } foreach ( $ this -> xpath -> query ( 'namespace::*[not(.=../../namespace::*)]' , $ ele ) as $ nsNode ) { if ( ! in_array ( $ nsNode -> nodeValue , $ this -> implicitNamespaces ) ) { $ this -> wr ( ' ' ) -> wr ( $ nsNode -> nodeName ) -> wr ( '="' ) -> wr ( $ nsNode -> nodeValue ) -> wr ( '"' ) ; } } }
Write the namespace attributes


@param \DOMNode $ele
The element being written.
Write the namespace attributes