hxt-9.3.1.18: A collection of tools for processing XML with Haskell.

Copyright | Copyright (C) 2008-2010 Uwe Schmidt
License | MIT
Maintainer | Uwe Schmidt (uwe@fh-wedel.de)
Stability | stable
Portability | portable
Safe Haskell | None
Language | Haskell98

Text.XML.HXT.DOM.TypeDefs

Description

The core data types of the HXT DOM.

Synopsis

- module Data.AssocList
- type ChildNodes = [(Int, XmlNodeSet)]
- data XmlNodeSet = XNS {
  - thisNode :: Bool
  - attrNodes :: [QName]
  - childNodes :: ChildNodes
  }
- type Attributes = AssocList String String
- type Blob = ByteString
- data DTDElem
  - = DOCTYPE
  - | ELEMENT
  - | CONTENT
  - | ATTLIST
  - | ENTITY
  - | PENTITY
  - | NOTATION
  - | CONDSECT
  - | NAME
  - | PEREF
- data XNode
  - = XText String
  - | XBlob Blob
  - | XCharRef Int
  - | XEntityRef String
  - | XCmt String
  - | XCdata String
  - | XPi QName XmlTrees
  - | XTag QName XmlTrees
  - | XDTD DTDElem Attributes
  - | XAttr QName
  - | XError Int String
- type XmlNavTrees = [NTZipper XNode]
- type XmlNavTree = NTZipper XNode
- type XmlTrees = NTrees XNode
- type XmlTree = NTree XNode
- rwnfAttributes :: Attributes -> ()
- blobToString :: Blob -> String
- stringToBlob :: String -> Blob
- c_ok :: Int
- c_warn :: Int
- c_err :: Int
- c_fatal :: Int
- module Text.XML.HXT.DOM.QualifiedName

# Documentation

module Data.AssocList

type ChildNodes = [(Int, XmlNodeSet)] Source #

data XmlNodeSet Source #

data type for representing a set of nodes as a tree structure

this structure is e.g. used to repesent the result of an XPath query such that the selected nodes can be processed or selected later in processing a document tree

Constructors

XNS |

Fields

- thisNode :: Bool

  is this node part of the set ?

- attrNodes :: [QName]

  the set of attribute nodes

- childNodes :: ChildNodes

  the set of child nodes, a list of pairs of index and node set

#### Instances

Instances details

Eq XmlNodeSet Source # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods (==) :: XmlNodeSet -> XmlNodeSet -> Bool (/=) :: XmlNodeSet -> XmlNodeSet -> Bool
Show XmlNodeSet Source # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods showsPrec :: Int -> XmlNodeSet -> ShowS show :: XmlNodeSet -> String showList :: [XmlNodeSet] -> ShowS

type Attributes = AssocList String String Source #

Attribute list

used for storing option lists and features of DTD parts

type Blob = ByteString Source #

Binary large object implemented as a lazy bytestring

data DTDElem Source #

Represents a DTD element

Constructors

DOCTYPE | attr: name, system, public, XDTD elems as children
ELEMENT | attr: name, kind name: element name kind: "EMPTY" | "ANY" | "#PCDATA" | children | mixed
CONTENT | element content attr: kind, modifier modifier: "" | "?" | "*" | "+" kind: seq | choice
ATTLIST | attributes: name - name of element value - name of attribute type: "CDATA" | "ID" | "IDREF" | "IDREFS" | "ENTITY" | "ENTITIES" | "NMTOKEN" | "NMTOKENS" |"NOTATION" | "ENUMTYPE" kind: "IMPLIED" | "DEFAULT"
ENTITY | for entity declarations
PENTITY | for parameter entity declarations
NOTATION | for notations
CONDSECT | for INCLUDEs, IGNOREs and peRefs: attr: type type = INCLUDE, IGNORE or %...;
NAME | attr: name for lists of names in notation types or nmtokens in enumeration types
PEREF | for Parameter Entity References in DTDs

#### Instances

Instances details

Enum DTDElem Source # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods succ :: DTDElem -> DTDElem pred :: DTDElem -> DTDElem toEnum :: Int -> DTDElem fromEnum :: DTDElem -> Int enumFrom :: DTDElem -> [DTDElem] enumFromThen :: DTDElem -> DTDElem -> [DTDElem] enumFromTo :: DTDElem -> DTDElem -> [DTDElem] enumFromThenTo :: DTDElem -> DTDElem -> DTDElem -> [DTDElem]
Eq DTDElem Source # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods (==) :: DTDElem -> DTDElem -> Bool (/=) :: DTDElem -> DTDElem -> Bool
Ord DTDElem Source # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods compare :: DTDElem -> DTDElem -> Ordering (<) :: DTDElem -> DTDElem -> Bool (<=) :: DTDElem -> DTDElem -> Bool (>) :: DTDElem -> DTDElem -> Bool (>=) :: DTDElem -> DTDElem -> Bool max :: DTDElem -> DTDElem -> DTDElem min :: DTDElem -> DTDElem -> DTDElem
Read DTDElem Source # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods readsPrec :: Int -> ReadS DTDElem readList :: ReadS [DTDElem] readPrec :: ReadPrec DTDElem readListPrec :: ReadPrec [DTDElem]
Show DTDElem Source # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods showsPrec :: Int -> DTDElem -> ShowS show :: DTDElem -> String showList :: [DTDElem] -> ShowS
WNFData DTDElem Source # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods rwnf :: DTDElem -> () Source # rwnf2 :: DTDElem -> () Source #
NFData DTDElem Source # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods rnf :: DTDElem -> ()
Binary DTDElem Source # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods put :: DTDElem -> Put get :: Get DTDElem putList :: [DTDElem] -> Put

data XNode Source #

Represents elements

Constructors

XText String | ordinary text (leaf)
XBlob Blob | text represented more space efficient as bytestring (leaf)
XCharRef Int | character reference (leaf)
XEntityRef String | entity reference (leaf)
XCmt String | comment (leaf)
XCdata String | CDATA section (leaf)
XPi QName XmlTrees | Processing Instr with qualified name (leaf) with list of attributes. If tag name is xml, attributes are "version", "encoding", "standalone", else attribute list is empty, content is a text child node
XTag QName XmlTrees | tag with qualified name and list of attributes (inner node or leaf)
XDTD DTDElem Attributes | DTD element with assoc list for dtd element features
XAttr QName | attribute with qualified name, the attribute value is stored in children
XError Int String | error message with level and text

#### Instances

Instances details

Eq XNode Source # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods (==) :: XNode -> XNode -> Bool (/=) :: XNode -> XNode -> Bool
Show XNode Source # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods showsPrec :: Int -> XNode -> ShowS show :: XNode -> String showList :: [XNode] -> ShowS
WNFData XNode Source # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods rwnf :: XNode -> () Source # rwnf2 :: XNode -> () Source #
NFData XNode Source # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods rnf :: XNode -> ()
Binary XNode Source # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods put :: XNode -> Put get :: Get XNode putList :: [XNode] -> Put
XmlNode XNode Source # |

Instance details

Defined in Text.XML.HXT.DOM.XmlNode

Methods

isText :: XNode -> Bool Source #

isBlob :: XNode -> Bool Source #

isCharRef :: XNode -> Bool Source #

isEntityRef :: XNode -> Bool Source #

isCmt :: XNode -> Bool Source #

isCdata :: XNode -> Bool Source #

isPi :: XNode -> Bool Source #

isElem :: XNode -> Bool Source #

isRoot :: XNode -> Bool Source #

isDTD :: XNode -> Bool Source #

isAttr :: XNode -> Bool Source #

isError :: XNode -> Bool Source #

mkText :: String -> XNode Source #

mkBlob :: Blob -> XNode Source #

mkCharRef :: Int -> XNode Source #

mkEntityRef :: String -> XNode Source #

mkCmt :: String -> XNode Source #

mkCdata :: String -> XNode Source #

mkPi :: QName -> XmlTrees -> XNode Source #

mkError :: Int -> String -> XNode Source #

getText :: XNode -> Maybe String Source #

getBlob :: XNode -> Maybe Blob Source #

getCharRef :: XNode -> Maybe Int Source #

getEntityRef :: XNode -> Maybe String Source #

getCmt :: XNode -> Maybe String Source #

getCdata :: XNode -> Maybe String Source #

getPiName :: XNode -> Maybe QName Source #

getPiContent :: XNode -> Maybe XmlTrees Source #

getElemName :: XNode -> Maybe QName Source #

getAttrl :: XNode -> Maybe XmlTrees Source #

getDTDPart :: XNode -> Maybe DTDElem Source #

getDTDAttrl :: XNode -> Maybe Attributes Source #

getAttrName :: XNode -> Maybe QName Source #

getErrorLevel :: XNode -> Maybe Int Source #

getErrorMsg :: XNode -> Maybe String Source #

getName :: XNode -> Maybe QName Source #

getQualifiedName :: XNode -> Maybe String Source #

getUniversalName :: XNode -> Maybe String Source #

getUniversalUri :: XNode -> Maybe String Source #

getLocalPart :: XNode -> Maybe String Source #

getNamePrefix :: XNode -> Maybe String Source #

getNamespaceUri :: XNode -> Maybe String Source #

changeText :: (String -> String) -> XNode -> XNode Source #

changeBlob :: (Blob -> Blob) -> XNode -> XNode Source #

changeCmt :: (String -> String) -> XNode -> XNode Source #

changeName :: (QName -> QName) -> XNode -> XNode Source #

changeElemName :: (QName -> QName) -> XNode -> XNode Source #

changeAttrl :: (XmlTrees -> XmlTrees) -> XNode -> XNode Source #

changeAttrName :: (QName -> QName) -> XNode -> XNode Source #

changePiName :: (QName -> QName) -> XNode -> XNode Source #

changeDTDAttrl :: (Attributes -> Attributes) -> XNode -> XNode Source #

setText :: String -> XNode -> XNode Source #

setBlob :: Blob -> XNode -> XNode Source #

setCmt :: String -> XNode -> XNode Source #

setName :: QName -> XNode -> XNode Source #

setElemName :: QName -> XNode -> XNode Source #

setElemAttrl :: XmlTrees -> XNode -> XNode Source #

setAttrName :: QName -> XNode -> XNode Source #

setPiName :: QName -> XNode -> XNode Source #

setDTDAttrl :: Attributes -> XNode -> XNode Source #

type XmlNavTrees = [NTZipper XNode] Source #

List of navigatable rose trees with XML nodes

type XmlNavTree = NTZipper XNode Source #

Navigatable rose tree with XML nodes

type XmlTrees = NTrees XNode Source #

List of rose trees with XML nodes

type XmlTree = NTree XNode Source #

Rose tree with XML nodes (XNode)

rwnfAttributes :: Attributes -> () Source #

Evaluate an assoc list of strings

blobToString :: Blob -> String Source #

stringToBlob :: String -> Blob Source #

c_ok :: Int Source #

no error, everything is ok

c_warn :: Int Source #

Error level for XError, type warning

c_err :: Int Source #

Error level for XError, type error

c_fatal :: Int Source #

Error level for XError, type fatal error

module Text.XML.HXT.DOM.QualifiedName