selectors-0.0.2.0: CSS Selectors for DOM traversal

Safe HaskellSafe-Inferred

XML.Selectors.CSS.Types

Description

Definitions of Tokens in the CSS selector grammar as well as the data types representing the parse result.

Synopsis

Documentation

data Selector Source

Top level entity representing the parse tree of a CSS path expression. Composed of one or more SimpleSelectors combined with a Comb relation.

data Comb Source

Type representing the relationship between two Selectors.

Constructors

Descendant

Any descendant; represented by plain whitespace in CSS

Child

Any direct child; represented by > in CSS

FollowingSibling

Directly following sibling node; represented by + in CSS

AnySibling

Any following sibling node; represented by ~ in CSS

data SimpleSelector Source

Type representing a single set of filters for selecting nodes. Contain an optional single element name, a sequence of id, class, and attribute Specifiers, and an optional pseudo-element selector.

data Specifier Source

Type representing id, class, and attribute filters.

data Pred Source

Type representing boolean operations on attribute values.

Constructors

None

Simple existence test

Pred PredOp String

String comparison test

data PredOp Source

Constructors

Equals

String equality

Includes

Contains word; ~=

DashMatch

String equality, optional dash following; |=

BeginsWith

String begins with; ^=

EndsWith

String ends with; $=

data Pseudo Source

Only supporting two pseudoelement selectors.

Constructors

FirstChild 
LastChild