Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- toAxis :: Selector -> Axis
- match :: Selector -> Cursor -> [Cursor]
- checkAttrib :: AttribSelector -> Axis
- checkElementAttribs :: AttribSelector -> Map Name Text -> Bool
- removeDoubles :: [Cursor] -> [Cursor]
- isSameCursor :: Cursor -> Cursor -> Bool
- cursorPath :: Cursor -> [Node]
Documentation
match :: Selector -> Cursor -> [Cursor] Source #
Directly apply a Selector
to a Cursor
, removing duplicates. Cursors
are considered duplicate iff their focus node and ancestory are the same.
Due to the knot-tying of the Cursor
type, this is not perfect: we are not
considering the focus node's position within its parent, so any two nodes
that are exactly identical themselves and share ancestory will be considered
equal. E.g., in the following XML document:
<root> <parent> <child>Foo</child> <child>Foo</child> </parent> </root>
...the two <child/>
nodes will be considered equal, even though they are
two distinct nodes in the DOM.
Unlike toAxis
, the match
function prepends an implicit
self-or-descendant Axis
to the selector in order to mimic the behavior of
actual CSS selectors.
checkAttrib :: AttribSelector -> Axis Source #
checkElementAttribs :: AttribSelector -> Map Name Text -> Bool Source #
removeDoubles :: [Cursor] -> [Cursor] Source #
cursorPath :: Cursor -> [Node] Source #