Exception thrown when a rewrite rule replaced an element with a new element that does not comply with the contract of its parent container.
Collects elements by applying the partial function to all elements it is defined for, in depth-first traversal, including this element itself.
Collects elements by applying the partial function to all elements it is defined for, in depth-first traversal, including this element itself.
Invokes the specified function for each child of this element container, including children of children, and this element itself, in depth-first traversal.
Invokes the specified function for each child of this element container, including children of children, and this element itself, in depth-first traversal.
Returns a new, rewritten tree model based on the specified rule.
Returns a new, rewritten tree model based on the specified rule.
The rule is a partial function that takes an Element
and returns an Option[Element]
.
If the function is not defined for a specific element the old element remains
in the tree unchanged. If it returns None
then the node gets removed from the tree,
if it returns an element it will replace the old one. Of course the function may
also return the old element.
The rewriting is performed in a way that only branches of the tree that contain new or removed elements will be replaced. It is processed bottom-up, therefore any element container passed to the rule only contains children which have already been processed.
In case multiple rewrite rules need to be applied it may be more efficient to
first combine them with orElse
.
Selects all elements satisfying the specified predicate, collecting in depth-first traversal, including this element itself.
Selects all elements satisfying the specified predicate, collecting in depth-first traversal, including this element itself.
A table consisting of a head and a body part and optional caption and column specification.