hexpat-0.2: wrapper for expat, the fast XML parserSource codeContentsIndex
Text.XML.Expat.Tree
Description
The Expat.Tree module provides a simplified interface to parsing, that returns a tree of the XML structure. It is written using the lower-level bindings in the Text.XML.Expat.IO module. (Note that this is not a lazy parse of the document: as soon as the root node is accessed, the entire document is parsed.)
Synopsis
parse :: Maybe Encoding -> ByteString -> Maybe Node
data Node
= Element {
eName :: String
eAttrs :: [(String, String)]
eChildren :: [Node]
}
| Text String
data Encoding
= ASCII
| UTF8
| UTF16
| ISO88591
Documentation
parse :: Maybe Encoding -> ByteString -> Maybe NodeSource
parse enc doc parses lazy bytestring XML content doc with optional encoding override enc and returns the root Node of the document if there were no parsing errors.
data Node Source
Simplistic XML tree representation.
Constructors
Element
eName :: String
eAttrs :: [(String, String)]
eChildren :: [Node]
Text String
show/hide Instances
data Encoding Source
Encoding types available for the document encoding.
Constructors
ASCII
UTF8
UTF16
ISO88591
Produced by Haddock version 2.1.0