|
|
|
|
|
Description |
This module provides functions to parse an XML document to a tree structure,
either strictly or lazily, as well as a lazy SAX-style interface.
Extensible "flavors" give you the ability to use any string type. Three
are provided here: String, ByteString and Text.
|
|
Synopsis |
|
|
|
|
Tree structure
|
|
|
The tree representation of the XML document.
| Constructors | Element | | eName :: !tag | | eAttrs :: ![(tag, text)] | | eChildren :: [Node tag text] | |
| Text !text | |
| Instances | |
|
|
Parse to tree
|
|
|
:: | | => TreeFlavor tag text | Flavor, which determines the string type to use in the tree
| -> Maybe Encoding | Optional encoding override
| -> ByteString | Input text (a lazy ByteString)
| -> (Node tag text, Maybe XMLParseError) | | Lazily parse XML to tree. Note that forcing the XMLParseError return value
will force the entire parse. Therefore, to ensure lazy operation, don't
check the error status until you have processed the tree.
|
|
|
|
:: | | => TreeFlavor tag text | Flavor, which determines the string type to use in the output
| -> Maybe Encoding | Optional encoding override
| -> ByteString | Input text (a lazy ByteString)
| -> Either XMLParseError (Node tag text) | | Strictly parse XML to tree. Returns error message or valid parsed tree.
|
|
|
|
Encoding types available for the document encoding.
| Constructors | |
|
|
|
Parse error, consisting of message text, line number, and column number
| Constructors | | Instances | |
|
|
SAX-style parse
|
|
|
:: | | => TreeFlavor tag text | Flavor, which determines the string type to use in the output
| -> Maybe Encoding | Optional encoding override
| -> ByteString | Input text (a lazy ByteString)
| -> [SAXEvent tag text] | | Lazily parse XML to SAX events. In the event of an error, FailDocument is
the last element of the output list.
|
|
|
|
Constructors | StartElement tag [(tag, text)] | | EndElement tag | | CharacterData text | | FailDocument XMLParseError | |
| Instances | |
|
|
Flavors
|
|
data TreeFlavor tag text | Source |
|
|
|
|
Flavor for String data type.
|
|
|
Flavor for ByteString data type, containing UTF-8 encoded Unicode.
|
|
|
Flavor for Text data type.
|
|
Produced by Haddock version 2.4.2 |