hexpat-iteratee-0.3: Chunked XML parsing using iterateesSource codeContentsIndex
Text.XML.Expat.Chunked
Contents
Tree structure
Generic node manipulation
Generic manipulation of the child list
Parse to tree
Synopsis
type CNode m tag text = NodeG (ListT (HandlerT m)) tag text
data NodeG c tag text
= Element {
eName :: !tag
eAttributes :: ![(tag, text)]
eChildren :: c (NodeG c tag text)
}
| Text !text
module Text.XML.Expat.NodeClass
module Data.List.Class
data ParserOptions tag text = ParserOptions {
parserEncoding :: Maybe Encoding
entityDecoder :: Maybe (tag -> Maybe text)
}
defaultParserOptions :: ParserOptions tag text
data Encoding
= ASCII
| UTF8
| UTF16
| ISO88591
parse :: forall m a tag text. (MonadIO m, GenericXMLString tag, GenericXMLString text) => ParserOptions tag text -> (CNode m tag text -> HandlerT m a) -> IterateeG WrappedByteString Word8 m (Either ErrMsg a)
data HandlerT m a = HandlerT {
runHandlerT :: m (Result m a)
}
data XMLParseError = XMLParseError String XMLParseLocation
data XMLParseLocation = XMLParseLocation {
xmlLineNumber :: Int64
xmlColumnNumber :: Int64
xmlByteIndex :: Int64
xmlByteCount :: Int64
}
Tree structure
type CNode m tag text = NodeG (ListT (HandlerT m)) tag textSource
A tree representation that uses a monadic list as its child list type.
data NodeG c tag text Source

The tree representation of the XML document.

c is the container type for the element's children, which is usually [], except when you are using chunked I/O with the hexpat-iteratee package.

tag is the tag type, which can either be one of several string types, or a special type from the Text.XML.Expat.Namespaced or Text.XML.Expat.Qualified modules.

text is the string type for text content.

Constructors
Element
eName :: !tag
eAttributes :: ![(tag, text)]
eChildren :: c (NodeG c tag text)
Text !text
show/hide Instances
(Functor c, List c) => NodeClass NodeG c
(Functor c, List c) => MkElementClass NodeG c
(Eq tag, Eq text) => Eq (NodeG [] tag text)
(Show tag, Show text) => Show (NodeG [] tag text)
(NFData tag, NFData text) => NFData (NodeG [] tag text)
Generic node manipulation
module Text.XML.Expat.NodeClass
Generic manipulation of the child list
module Data.List.Class
Parse to tree
data ParserOptions tag text Source
Constructors
ParserOptions
parserEncoding :: Maybe EncodingThe encoding parameter, if provided, overrides the document's encoding declaration.
entityDecoder :: Maybe (tag -> Maybe text)If provided, entity references (i.e.   and friends) will be decoded into text using the supplied lookup function
defaultParserOptions :: ParserOptions tag textSource
data Encoding Source
Encoding types available for the document encoding.
Constructors
ASCII
UTF8
UTF16
ISO88591
parse :: forall m a tag text. (MonadIO m, GenericXMLString tag, GenericXMLString text) => ParserOptions tag text -> (CNode m tag text -> HandlerT m a) -> IterateeG WrappedByteString Word8 m (Either ErrMsg a)Source

An iteratee that parses the input document, passing a representation of it to the specified handler monad. The monad runs lazily using co-routines, so if it requests a part of the tree that hasn't been parsed yet, it will be suspended, and continued when it's available.

This implementation does not use Haskell's lazy I/O.

data HandlerT m a Source
Constructors
HandlerT
runHandlerT :: m (Result m a)
show/hide Instances
data XMLParseError Source
Parse error, consisting of message text and error location
Constructors
XMLParseError String XMLParseLocation
show/hide Instances
data XMLParseLocation Source
Specifies a location of an event within the input text
Constructors
XMLParseLocation
xmlLineNumber :: Int64Line number of the event
xmlColumnNumber :: Int64Column number of the event
xmlByteIndex :: Int64Byte index of event from start of document
xmlByteCount :: Int64The number of bytes in the event
show/hide Instances
Produced by Haddock version 2.6.1