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.

Constructors

this
this(DOMImplementation impl, Args args)
Undocumented in source.

Alias This

cursor

Members

Aliases

DocumentType
alias DocumentType = ReturnType!(DOMImplementation.createDocument)
Undocumented in source.
NodeType
alias NodeType = typeof(DocumentType.firstChild)
Undocumented in source.
StringType
alias StringType = T.StringType
Undocumented in source.

Functions

build
void 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
bool 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
bool 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
void exit()

Same as cursor.exit

getDocument
auto getDocument()

Returns the Document being built by this builder.

next
bool next()

Same as cursor.next.

setSource
void setSource(T.InputType input)

Initializes this builder and the underlying components.

Variables

cursor
T cursor;

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

Meta