Returns the ancestors, starting with the parent (if any), and ending with the root ancestry path
Returns the ancestors-or-self, starting with this ancestry path, then the parent (if any), and ending with a root path
Returns AncestryPath.fromEntry(firstEntry)
.
Returns the ENames, from the last entry to the root entry.
Returns ancestors find { path => p(path) }
Returns ancestorsOrSelf find { path => p(path) }
The ancestry path entry pointing to "this element", which is the first entry.
Returns true if this ancestry path has only one entry.
Like parentOption
, but unwrapping the result (or throwing an exception otherwise)
Gets the parent ancestry path (if any, because a root ancestry path has no parent) wrapped in an Option
.
Prepends a new first entry to this ancestry path.
Returns the QNames, from the last entry to the root entry.
Returns AncestryPath.fromEntry(rootEntry)
.
The ancestry path entry pointing to the "root element", which is the last entry.
The ancestry path of an element in an element tree. The first entry represents the "current" element, and the last one the "root" element. Each entry is like an element without its children, but with the element QName, Scope and attributes (mapping QNames to attribute values).
An
AncestryPath
is quite different from aPath
. The former represents the ancestry-or-self of an element in an element tree, while the latter represents a series of steps to navigate through an element tree, to descendant-or-self elements. Ancestry paths have no knowledge of the siblings of "this" element or of its ancestors, while (navigation) paths can be used to navigate to any descendant-or-self element. Hence an ancestry path is a property of an element in a tree, whereas a (navigation) path is a navigation notion (through an element tree). The latter should really be called NavigationPath. Both concepts have in common that they only know about element nodes.An AncestryPath can be thought of as a stack where the head is the "current" element and the tail is the ancestor elements.