| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Text.XML.Selectors.Types
Description
Synopsis
- data Selector
- selectorAppend :: Selector -> Selector -> Selector
- (<||>) :: Selector -> Selector -> Selector
- data AttribSelector
Documentation
Node-level selectors and combinators
Constructors
| None | |
| Any | * |
| Append Selector Selector |
|
| Elem Name | div |
| Attrib AttribSelector | a[...] |
| Descendant |
|
| Child | > |
| Sibling | ~ |
| NextSibling | + |
| FirstChild | :first-child |
| LastChild | :last-child |
| NthChild Int | :nth-child(n); :nth-last-child(-n) |
| Choice [Selector] | a,b,... |
| Having Selector | :has(b) |
| Not Selector | :not(b) |
Instances
| Monoid Selector Source # | The |
| Semigroup Selector Source # | The |
| Show Selector Source # | |
(<||>) :: Selector -> Selector -> Selector infixl 3 Source #
An alternative semigroup of selectors, representing choice.
a <||> b selects all nodes that match a and also all nodes that match
b. In other words: a <||> b == Choice a b. Note however that the
<||> operator culls redundant applications of Choice, e.g.,
a <||> b <||> c becomes Choice [a, b, c] rather than
Choice [a, Choice [b, c]]. This alternative semigroup could be extended
into a monoid, with the empty choice (Choice []) as the neutral value,
but we were far too lazy to add that.
data AttribSelector Source #
Attribute-level selectors
Constructors
| AttribExists Name | [attr] |
| AttribIs Name Text | [attr=blah] |
| AttribIsNot Name Text | [attr!=blah] |
| AttribStartsWith Name Text | [attr^=blah] |
| AttribEndsWith Name Text | [attr$=blah] |
| AttribContains Name Text | [attr*=blah] |
| AttribContainsWord Name Text | [attr~=blah] |
| AttribContainsPrefix Name Text | [attr|=blah] |
Instances
| Show AttribSelector Source # | |
Defined in Text.XML.Selectors.Types Methods showsPrec :: Int -> AttribSelector -> ShowS # show :: AttribSelector -> String # showList :: [AttribSelector] -> ShowS # | |
| Eq AttribSelector Source # | |
Defined in Text.XML.Selectors.Types Methods (==) :: AttribSelector -> AttribSelector -> Bool # (/=) :: AttribSelector -> AttribSelector -> Bool # | |