Returns the ancestors / parents of the path
The * and @ must be swapped otherwise its an annotation
Simple container for keeping relationship between the parent and attribute
Attributes that have been selected
Base trait for XPath Axis, also provides common functionality
Dummy implicit filler for easing interface issues
Pos and filter for a direct access does not flatmap.
Following and preceding split the document in two
Iterates over paths using the document order as per the following_:: axis.
Collects all type class based xpath functions, exposed via Functions in package
Collects all type class based xpath functions, exposed via Functions in package
Also adds aliases for the common functions
Functions providing access to QNames
Type class representing Xml objects which provide qnames.
Type class representing Xml objects which provide qnames. Most of the functions allow for implicit scope to ease use in xpaths.
Name type classes
Little depature from standard, rather than duplicate all of the \ and \\ nodes, just a simple \\*() comment() will do
Little depature from standard, rather than duplicate all of the \ and \\ nodes, just a simple \\*() comment() will do
NOTE these have a large performance hit as the must sort and filter the results in order to get doc order. Better to use specific nodes avoiding \\ etc, then use the s for simple functions, sutext etc for simple useful. Additionally using the non simple versions incurs the cost of adding adjacent text node processing as per standard datamodel (all adjacent text nodes are joined and any resulting nodes that are "the zero-length string" are removed).
TODO xpath adjacent text node handling
Iterates over paths using reverse document order and, as per the preceding_:: axis, skips all ancestors.
Unlike XPath spec no reverse axis are directly provided by the dsl
Type class for text values
In contrast to the specs reverse axis are not supported.
In contrast to the specs reverse axis are not supported. This puts an extra effort on the user for translating, but I don't agree with the design anyway. It adds both ambiguity for an embedded dsl:
//a:ShouldRedeclare/../text()[5]/preceding-sibling::text()[1]
is in reverse order (above is previousSibling in Path), whereas
(//a:ShouldRedeclare/../text()[5]/preceding-sibling::text())[1]
is in doc order (the first text child of the parent). Such an arbritary decision does nothing but irritate. A simpler design as found in this implementation is that the user can simply use full scala data functions to reverse as needed.
(Temptation is to provide the base type as SeqLike instead of Iterable as it should be in a sequence with a defined order, also then providing .reverse and friends)
XPaths need sorting upon unions etc, and duplicate filtering on \^ parents
Represents an empty qname for those cases that should return empty string
Represents an empty qname for those cases that should return empty string
Pos and filter for a direct access does not flatmap. The next / breaks the chain