polysoup-0.3.0: Online XML parsing with polyparse and tagsoup

Safe HaskellNone

Text.XML.PolySoup.Tag

Contents

Description

The module provides tag-level predicates.

Synopsis

Tag queries

getName :: Tag s -> Maybe sSource

Get name of the tag.

getText :: Tag s -> Maybe sSource

Get contents of the text node. A synonym for maybeTagText.

getAttr :: Eq s => s -> Tag s -> Maybe sSource

Get value of the attribute.

getAtts :: Tag s -> Maybe [(s, s)]Source

Get name of the tag.

Extraction predicates

name :: Q (Tag s) sSource

Extract the tag name.

text :: Q (Tag s) sSource

Extract textual contents of the text node.

attr :: Eq s => s -> Q (Tag s) sSource

Extract the attribute value.

atts :: Q (Tag s) [(s, s)]Source

Extract the attribute value.

Tag predicates

innerTag :: Q (Tag s) (Tag s)Source

Internal node (i.e., an opening tag).

leafTag :: Q (Tag s) (Tag s)Source

Leaf node (everything but an opening tag).

textTag :: Q (Tag s) (Tag s)Source

A text node.

commentTag :: Q (Tag s) (Tag s)Source

A comment node.

warningTag :: Q (Tag s) (Tag s)Source

A warning node.

positionTag :: Q (Tag s) (Tag s)Source

A position node.

named :: Eq s => s -> Q (Tag s) (Tag s)Source

Does it have a given name?

hasAttr :: Eq s => s -> Q (Tag s) (Tag s)Source

Does it have a given attribute?

hasAttrVal :: Eq s => s -> s -> Q (Tag s) (Tag s)Source

Does it have a given attribute with a given value?