Struct DOMBuilder

Built on top of Cursor, the DOM builder adds to it the ability to build the DOM tree of the document; as the cursor advances, nodes can be selectively added to the tree, allowing to built a small representation containing only the needed parts of the document.

This type should not be instantiated directly. Instead, the helper function domBuilder should be used.

Template arguments

struct DOMBuilder(T, DOMImplementation)
if (isCursor!T && is(DOMImplementation : dom.DOMImplementation!(T.StringType)));

Fields

Name Type Description
cursor T The underlying Cursor methods are exposed, so that one can, query the properties of the current node before deciding if building it or not.

Methods

Name Description
build Adds the current node to the DOM. This operation does not advance the input. Calling it more than once does not change the result.
buildRecursive Recursively adds the current node and all its children to the DOM tree. Behaves as cursor.next: it advances the input to the next sibling, returning true if and only if there exists such next sibling.
enter Same as cursor.enter. When entering a node, that node is automatically built into the DOM, so that its children can then be safely built if needed.
exit Same as cursor.exit
getDocument Returns the Document being built by this builder.
next Same as cursor.next.
setSource Initializes this builder and the underlying components.

Authors

Lodovico Giaretta

Copyright

Copyright Lodovico Giaretta 2016 --

License

Boost License 1.0.