|
|
|
|
|
Description |
A variant of Node in which Element nodes have an annotation of any type,
and some concrete functions that annotate with the XML parse location.
It is assumed you will usually want Tree or Annotated, not both, so many
of the names conflict.
Support for qualified and namespaced trees annotated with location information
is not complete.
|
|
Synopsis |
|
| | type Attributes tag text = [(tag, text)] | | type Nodes tag text a = [Node tag text a] | | type UNode text a = Node text text a | | type UNodes text a = Nodes text text a | | type UAttributes text = Attributes text text | | type LNode tag text = Node tag text XMLParseLocation | | type LNodes tag text = [Node tag text XMLParseLocation] | | type ULNode text = LNode text text | | type ULNodes text = LNodes text text | | textContent :: Monoid text => Node tag text a -> text | | unannotate :: Node tag text a -> Node tag text | | data QName text = QName {} | | type QNode text a = Node (QName text) text a | | type QNodes text a = Nodes (QName text) text a | | type QAttributes text = Attributes (QName text) text | | type QLNode text = LNode (QName text) text | | type QLNodes text = LNodes (QName text) text | | data NName text = NName {} | | type NNode text a = Node (NName text) text a | | type NNodes text a = Nodes (NName text) text a | | type NAttributes text = Attributes (NName text) text | | type NLNode text = LNode (NName text) text | | type NLNodes text = LNodes (NName text) text | | mkNName :: text -> text -> NName text | | mkAnNName :: text -> NName text | | xmlnsUri :: GenericXMLString text => text | | xmlns :: GenericXMLString text => text | | parseTree :: (GenericXMLString tag, GenericXMLString text) => Maybe Encoding -> ByteString -> (LNode tag text, Maybe XMLParseError) | | parseTree' :: (GenericXMLString tag, GenericXMLString text) => Maybe Encoding -> ByteString -> Either XMLParseError (LNode tag text) | | | | data XMLParseError = XMLParseError String XMLParseLocation | | data XMLParseLocation = XMLParseLocation {} | | parseSAX :: (GenericXMLString tag, GenericXMLString text) => Maybe Encoding -> ByteString -> [SAXEvent tag text] | | | | saxToTree :: GenericXMLString tag => [(SAXEvent tag text, a)] -> (Node tag text a, Maybe XMLParseError) | | parseSAXLocations :: (GenericXMLString tag, GenericXMLString text) => Maybe Encoding -> ByteString -> [(SAXEvent tag text, XMLParseLocation)] | | data XMLParseException = XMLParseException XMLParseError | | parseTreeThrowing :: (GenericXMLString tag, GenericXMLString text) => Maybe Encoding -> ByteString -> LNode tag text | | parseSAXThrowing :: (GenericXMLString tag, GenericXMLString text) => Maybe Encoding -> ByteString -> [SAXEvent tag text] | | parseSAXLocationsThrowing :: (GenericXMLString tag, GenericXMLString text) => Maybe Encoding -> ByteString -> [(SAXEvent tag text, XMLParseLocation)] | | class (Monoid s, Eq s) => GenericXMLString s where | |
|
|
|
Tree structure
|
|
|
Annotated variant of the tree representation of the XML document.
| Constructors | Element | | eName :: !tag | | eAttrs :: ![(tag, text)] | | eChildren :: [Node tag text a] | | eAnn :: a | |
| Text !text | |
| Instances | |
|
|
type Attributes tag text = [(tag, text)] | Source |
|
Type shortcut for attributes
|
|
|
Type shortcut for annotated nodes
|
|
|
Type shortcut for a single annotated node with unqualified tag names where
tag and text are the same string type
|
|
|
Type shortcut for annotated nodes with unqualified tag names where tag and
text are the same string type
|
|
|
Type shortcut for attributes with unqualified names where tag and
text are the same string type.
|
|
|
Type shortcut for a single annotated node, annotated with parse location
|
|
|
Type shortcut for annotated nodes with location information.
|
|
|
Type shortcut for a single node with unqualified tag names where
tag and text are the same string type, annotated with parse location
|
|
|
Type shortcut for nodes with unqualified tag names where
tag and text are the same string type, annotated with parse location
|
|
|
Extract all text content from inside a tag into a single string, including
any text contained in children.
|
|
|
|
Qualified nodes
|
|
|
A qualified name.
Qualified names have two parts, a prefix and a local part. The local part
is the name of the tag. The prefix scopes that name to a particular
group of legal tags.
The prefix will usually be associated with a namespace URI. This is usually
achieved by using xmlns attributes to bind prefixes to URIs.
| Constructors | QName | | qnPrefix :: Maybe text | | qnLocalPart :: !text | |
|
| Instances | |
|
|
|
Type shortcut for a single annotated node where qualified names are used for tags
|
|
|
Type shortcut for annotated nodes where qualified names are used for tags
|
|
|
Type shortcut for attributes with qualified names
|
|
|
Type shortcut for a single node where qualified names are used for tags, annotated with parse location
|
|
|
Type shortcut for nodes where qualified names are used for tags, annotated with parse location
|
|
Namespaced nodes
|
|
|
A namespace-qualified tag.
NName has two components, a local part and an optional namespace. The local part is the
name of the tag. The namespace is the URI identifying collections of declared tags.
Tags with the same local part but from different namespaces are distinct. Unqualified tags
are those with no namespace. They are in the default namespace, and all uses of an
unqualified tag are equivalent.
| Constructors | NName | | nnNamespace :: Maybe text | | nnLocalPart :: !text | |
|
| Instances | |
|
|
|
Type shortcut for a single annotated node where namespaced names are used for tags
|
|
|
Type shortcut for annotated nodes where namespaced names are used for tags
|
|
|
Type shortcut for attributes with namespaced names
|
|
|
Type shortcut for a single node where namespaced names are used for tags, annotated with parse location
|
|
|
Type shortcut for nodes where namespaced names are used for tags, annotated with parse location
|
|
|
Make a new NName from a prefix and localPart.
|
|
|
Make a new NName with no prefix.
|
|
|
|
|
|
Parse to tree
|
|
|
|
|
|
|
|
|
Encoding types available for the document encoding.
| Constructors | |
|
|
|
Parse error, consisting of message text and error location
| Constructors | | Instances | |
|
|
|
Specifies a location of an event within the input text
| Constructors | XMLParseLocation | | xmlLineNumber :: Int64 | Line number of the event
| xmlColumnNumber :: Int64 | Column number of the event
| xmlByteIndex :: Int64 | Byte index of event from start of document
| xmlByteCount :: Int64 | The number of bytes in the event
|
|
| Instances | |
|
|
SAX-style parse
|
|
|
|
|
|
Constructors | StartElement tag [(tag, text)] | | EndElement tag | | CharacterData text | | FailDocument XMLParseError | |
| Instances | |
|
|
|
A lower level function that lazily converts a SAX stream into a tree structure.
Variant that takes annotations for start tags.
|
|
|
|
|
Variants that throw exceptions
|
|
|
An exception indicating an XML parse error, used by the ..Throwing variants.
| Constructors | | Instances | |
|
|
|
|
|
|
|
|
parseSAXLocationsThrowing | Source |
|
|
|
Abstraction of string types
|
|
|
An abstraction for any string type you want to use as xml text (that is,
attribute values or element text content). If you want to use a
new string type with hexpat, you must make it an instance of
GenericXMLString.
| | Methods | | | Instances | |
|
|
Produced by Haddock version 2.6.0 |