hxt-9.1.6: A collection of tools for processing XML with Haskell.

Portability | portable
Stability | experimental
Maintainer | Uwe Schmidt (uwe\@fh-wedel.de)

Data.Tree.NavigatableTree.XPathAxis

Description

Navigatable trees need to have operations to move up, down, left and right. With these elementary operations, the XPath axises can be defined.

Synopsis

- maybeStar :: (a -> Maybe a) -> a -> [a]
- maybePlus :: (a -> Maybe a) -> a -> [a]
- parentAxis :: NavigatableTree t => t a -> [t a]
- ancestorAxis :: NavigatableTree t => t a -> [t a]
- ancestorOrSelfAxis :: NavigatableTree t => t a -> [t a]
- childAxis :: NavigatableTree t => t a -> [t a]
- descendantAxis :: NavigatableTree t => t a -> [t a]
- descendantOrSelfAxis :: NavigatableTree t => t a -> [t a]
- revDescendantOrSelfAxis :: NavigatableTree t => t a -> [t a]
- followingSiblingAxis :: NavigatableTree t => t a -> [t a]
- precedingSiblingAxis :: NavigatableTree t => t a -> [t a]
- selfAxis :: NavigatableTree t => t a -> [t a]
- followingAxis :: NavigatableTree t => t a -> [t a]
- precedingAxis :: NavigatableTree t => t a -> [t a]
- mvToRoot :: NavigatableTree t => t a -> t a
- isAtRoot :: NavigatableTree t => t a -> Bool

# Documentation

maybeStar :: (a -> Maybe a) -> a -> [a]

collect all trees by moving into one direction, starting tree is included

maybePlus :: (a -> Maybe a) -> a -> [a]

collect all trees by moving into one direction, starting tree is not included

parentAxis :: NavigatableTree t => t a -> [t a]

XPath axis: parent

ancestorAxis :: NavigatableTree t => t a -> [t a]

XPath axis: ancestor

ancestorOrSelfAxis :: NavigatableTree t => t a -> [t a]

XPath axis: ancestor or self

childAxis :: NavigatableTree t => t a -> [t a]

XPath axis: child

descendantAxis :: NavigatableTree t => t a -> [t a]

XPath axis: descendant

descendantOrSelfAxis :: NavigatableTree t => t a -> [t a]

XPath axis: descendant or self

revDescendantOrSelfAxis :: NavigatableTree t => t a -> [t a]

not an official XPath axis but useful: reverse descendant or self, used in preceding axis

followingSiblingAxis :: NavigatableTree t => t a -> [t a]

XPath axis: following sibling

precedingSiblingAxis :: NavigatableTree t => t a -> [t a]

XPath axis: preceeding sibling

selfAxis :: NavigatableTree t => t a -> [t a]

XPath axis: self

followingAxis :: NavigatableTree t => t a -> [t a]

XPath axis: following

precedingAxis :: NavigatableTree t => t a -> [t a]

XPath axis: preceding

mvToRoot :: NavigatableTree t => t a -> t a

move to the root

isAtRoot :: NavigatableTree t => t a -> Bool