Returns the same element, except that child elements have been replaced by applying the given function.
Returns the same element, except that child elements have been replaced by applying the given function. Non-element child nodes occur in the result element unaltered.
That is, returns the equivalent of:
val newChildren = children map { case e: E => f(e) case n: N => n } withChildren(newChildren)
Returns the same element, except that child elements have been replaced by applying the given function.
Returns the same element, except that child elements have been replaced by applying the given function. Non-element child nodes occur in the result element unaltered.
That is, returns the equivalent of:
val newChildren = children flatMap { case e: E => f(e) case n: N => Vector(n) } withChildren(newChildren)
Transforms the element by applying the given function to all its descendant elements, in a bottom-up manner.
Transforms the element by applying the given function to all its descendant elements, in a bottom-up manner.
That is, returns the equivalent of:
transformChildElems (e => e.transformElemsOrSelf(f))
Transforms the element by applying the given function to all its descendant-or-self elements, in a bottom-up manner.
Transforms the element by applying the given function to all its descendant-or-self elements, in a bottom-up manner.
That is, returns the equivalent of:
f(transformChildElems (e => e.transformElemsOrSelf(f)))
In other words, returns the equivalent of:
f(transformElems(f))
Transforms each descendant element to a node sequence by applying the given function to all its descendant-or-self elements, in a bottom-up manner.
Transforms each descendant element to a node sequence by applying the given function to all its descendant-or-self elements, in a bottom-up manner.
That is, returns the equivalent of:
f(transformChildElemsToNodeSeq(e => e.transformElemsOrSelfToNodeSeq(f)))
In other words, returns the equivalent of:
f(transformElemsToNodeSeq(f))
Transforms each descendant element to a node sequence by applying the given function to all its descendant elements, in a bottom-up manner.
Transforms each descendant element to a node sequence by applying the given function to all its descendant elements, in a bottom-up manner. The function is not applied to this element itself.
That is, returns the equivalent of:
transformChildElemsToNodeSeq(e => e.transformElemsOrSelfToNodeSeq(f))
It is equivalent to the following expression:
transformElemsOrSelf { e => e.transformChildElemsToNodeSeq(che => f(che)) }
API and implementation trait for transformable elements.
More precisely, this trait has abstract methods
transformChildElems
andtransformChildElemsToNodeSeq
. Based on these abstract methods, this trait offers a rich API for transforming descendant elements or descendant-or-self elements.The purely abstract API offered by this trait is TransformableElemApi. See the documentation of that trait for examples of usage.
The node supertype of the element subtype
The captured element subtype