xml-query-0.9.1: A parser-agnostic declarative API for querying XML-documents

Safe HaskellNone
LanguageHaskell2010

XMLQuery

Contents

Synopsis

Text

type Text = Alt Text Source

Parser in the context of a textual value.

text :: (Text -> Either Text a) -> Text a Source

Lifts an arbitrary textual parser function to the text-value parser.

Provides a doorway for composition with such libraries as "parsec" or "attoparsec".

Derivatives

textValue :: Text Text Source

Simply extracts the textual value.

Element

elementAttr :: Attr a -> Element a Source

Parses one of element's attributes without any regard to order.

elementNodes :: Nodes a -> Element a Source

Parses all of element's nodes.

Can be used multiple times, thus allowing for parallel parsing of element's child-nodes. Naturally this will result in traversing the element's nodes multiple times.

Derivatives

Attr

attrNameText :: Text a -> Attr a Source

Parses the attribute's name using the provided textual parser.

attrValueText :: Text a -> Attr a Source

Parses the attribute's value using the provided textual parser.

Derivatives

attrNameIs :: Text -> Attr () Source

A parser, which succeeds if the attribute's name matches the provided value.

attrValueIs :: Text -> Attr () Source

A parser, which succeeds if the attribute's value matches the provided value.

Nodes

type Nodes = Alt Nodes Source

A sequential backtracking parser of nodes.

nodesImmediateNode :: Node a -> Nodes a Source

Parses the next node.

nodesEventualNode :: Node a -> Nodes a Source

Parses one of the following nodes.

Node