src/PowerTools/HTML5/Serializer/Traverser.php
public function walk() {
        if ($this->dom instanceof \DOMDocument) {
            $this->rules->document($this->dom);
        } elseif ($this->dom instanceof \DOMDocumentFragment) {
            // Document fragments are a special case. Only the children need to
            // be serialized.
            if ($this->dom->hasChildNodes()) {
                $this->children($this->dom->childNodes);
            }
        }        // If NodeList, loop
        elseif ($this->dom instanceof \DOMNodeList) {
            // If this is a NodeList of DOMDocuments this will not work.
            $this->children($this->dom);
        }         // Else assume this is a DOMNode-like datastructure.
        else {
            $this->node($this->dom);
        }

        return $this->out;
    }
public function walk() {
        if ($this->dom instanceof \DOMDocument) {
            $this->rules->document($this->dom);
        } elseif ($this->dom instanceof \DOMDocumentFragment) {
            // Document fragments are a special case. Only the children need to
            // be serialized.
            if ($this->dom->hasChildNodes()) {
                $this->children($this->dom->childNodes);
            }
        }        // If NodeList, loop
        elseif ($this->dom instanceof \DOMNodeList) {
            // If this is a NodeList of DOMDocuments this will not work.
            $this->children($this->dom);
        }         // Else assume this is a DOMNode-like datastructure.
        else {
            $this->node($this->dom);
        }

        return $this->out;
    }
public function walk ( ) { if ( $ this -> dom instanceof \ DOMDocument ) { $ this -> rules -> document ( $ this -> dom ) ; } elseif ( $ this -> dom instanceof \ DOMDocumentFragment ) { // Document fragments are a special case. Only the children need to // be serialized. if ( $ this -> dom -> hasChildNodes ( ) ) { $ this -> children ( $ this -> dom -> childNodes ) ; } } // If NodeList, loop elseif ( $ this -> dom instanceof \ DOMNodeList ) { // If this is a NodeList of DOMDocuments this will not work. $ this -> children ( $ this -> dom ) ; } // Else assume this is a DOMNode-like datastructure. else { $ this -> node ( $ this -> dom ) ; } return $ this -> out ; }
Tell the traverser to walk the DOM.

@return resource $out
Returns the output stream.
Tell the traverser to walk the DOM .