xml-parsec-1.0.3: Parsing XML with Parsec

MaintainerHenning Guenther

Text.ParserCombinators.Parsec.XML

Description

Helper functions to use a Parsec-Parser for XML documents.

Synopsis

Documentation

type XMLParser a = GenParser (Content Posn) () aSource

A Parser for XML Content.

anyContent :: XMLParser (Content Posn)Source

Accepts any content.

content :: (Content Posn -> Maybe a) -> XMLParser aSource

Accepts content verified by a function.

element :: XMLParser (Element Posn)Source

Forces an Element as next token.

text :: XMLParser StringSource

Forces plain text as next token.

namedElement :: String -> XMLParser [Content Posn]Source

As namedElementWithAttrs, ony that the attributes are ignored.

namedElementWithAttrs :: String -> XMLParser ([Attribute], [Content Posn])Source

Parses an element with given name. Returns the xml Attributes.

stringElement :: String -> XMLParser StringSource

Parses an element with a given name. The text content is returned.

recurse :: XMLParser a -> [Content Posn] -> XMLParser aSource

Helper function to recurse through an XML document.

recurseElements :: XMLParser a -> [Content Posn] -> XMLParser aSource

Helper function to recurse through an XML document.