class Traverser

Traverser for walking a DOM tree.

This is a concrete traverser designed to convert a DOM tree into an HTML5 document. It is not intended to be a generic DOMTreeWalker implementation.

Methods

__construct($dom, $out, RulesInterface $rules, $options = array())

Create a traverser.

resource
walk()

Tell the traverser to walk the DOM.

node( mixed $node)

Process a node in the DOM.

children( DOMNodeList $nl)

Walk through all the nodes on a node list.

bool
isLocalElement( mixed $ele)

Is an element local?

Details

at line line 49
__construct($dom, $out, RulesInterface $rules, $options = array())

Create a traverser.

Parameters

$dom
$out
RulesInterface $rules
$options

at line line 65
resource walk()

Tell the traverser to walk the DOM.

Return Value

resource $out Returns the output stream.

at line line 93
node( mixed $node)

Process a node in the DOM.

Parameters

mixed $node A node implementing \DOMNode.

at line line 125
children( DOMNodeList $nl)

Walk through all the nodes on a node list.

Parameters

DOMNodeList $nl A list of child elements to walk through.

at line line 140
bool isLocalElement( mixed $ele)

Is an element local?

Parameters

mixed $ele An element that implement \DOMNode.

Return Value

bool True if local and false otherwise.