polysoup-0.6: Online XML parsing with polyparse and tagsoup

Safe HaskellSafe-Inferred
LanguageHaskell98

Text.XML.PolySoup.Tag

Contents

Description

The module provides tag-level predicates.

Synopsis

Tag queries

getName :: Tag s -> Maybe s Source

Get name of the tag.

getText :: Tag s -> Maybe s Source

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

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

Get value of the attribute.

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

Get the list of the attributes.

Extraction predicates

name :: Q (Tag s) s Source

Extract the tag name.

text :: Q (Tag s) s Source

Extract textual contents of the text node.

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

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?