Text.XML.HXT.DOM.TypeDefs

hxt-9.3.1.22: 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 | Haskell2010

Text.XML.HXT.DOM.TypeDefs

Description

The core data types of the HXT DOM.

Synopsis

- module Data.AssocList
- type XmlTree = NTree XNode
- 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 XmlTrees = NTrees XNode
- type XmlNavTree = NTZipper XNode
- type XmlNavTrees = [NTZipper XNode]
- type Blob = ByteString
- data DTDElem
  - = DOCTYPE
  - | ELEMENT
  - | CONTENT
  - | ATTLIST
  - | ENTITY
  - | PENTITY
  - | NOTATION
  - | CONDSECT
  - | NAME
  - | PEREF
- type Attributes = AssocList String String
- rwnfAttributes :: Attributes -> ()
- blobToString :: Blob -> String
- stringToBlob :: String -> Blob
- c_ok :: Int
- c_warn :: Int
- c_err :: Int
- c_fatal :: Int
- data XmlNodeSet = XNS {
  - thisNode :: Bool
  - attrNodes :: [QName]
  - childNodes :: ChildNodes
  }
- type ChildNodes = [(Int, XmlNodeSet)]
- module Text.XML.HXT.DOM.QualifiedName

# Documentation

module Data.AssocList

type XmlTree = NTree XNode #

Rose tree with XML nodes (XNode)

data XNode #

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

Binary XNode # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods put :: XNode -> Put # get :: Get XNode # putList :: [XNode] -> Put #
NFData XNode # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods rnf :: XNode -> () #
Show XNode # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods showsPrec :: Int -> XNode -> ShowS # show :: XNode -> String # showList :: [XNode] -> ShowS #
Eq XNode # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods (==) :: XNode -> XNode -> Bool # (/=) :: XNode -> XNode -> Bool #
WNFData XNode # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods rwnf :: XNode -> () # rwnf2 :: XNode -> () #
XmlNode XNode # |
Instance details Defined in Text.XML.HXT.DOM.XmlNode Methods isText :: XNode -> Bool # isBlob :: XNode -> Bool # isCharRef :: XNode -> Bool # isEntityRef :: XNode -> Bool # isCmt :: XNode -> Bool # isCdata :: XNode -> Bool # isPi :: XNode -> Bool # isElem :: XNode -> Bool # isRoot :: XNode -> Bool # isDTD :: XNode -> Bool # isAttr :: XNode -> Bool # isError :: XNode -> Bool # mkText :: String -> XNode # mkBlob :: Blob -> XNode # mkCharRef :: Int -> XNode # mkEntityRef :: String -> XNode # mkCmt :: String -> XNode # mkCdata :: String -> XNode # mkPi :: QName -> XmlTrees -> XNode # mkError :: Int -> String -> XNode # getText :: XNode -> Maybe String # getBlob :: XNode -> Maybe Blob # getCharRef :: XNode -> Maybe Int # getEntityRef :: XNode -> Maybe String # getCmt :: XNode -> Maybe String # getCdata :: XNode -> Maybe String # getPiName :: XNode -> Maybe QName # getPiContent :: XNode -> Maybe XmlTrees # getElemName :: XNode -> Maybe QName # getAttrl :: XNode -> Maybe XmlTrees # getDTDPart :: XNode -> Maybe DTDElem # getDTDAttrl :: XNode -> Maybe Attributes # getAttrName :: XNode -> Maybe QName # getErrorLevel :: XNode -> Maybe Int # getErrorMsg :: XNode -> Maybe String # getName :: XNode -> Maybe QName # getQualifiedName :: XNode -> Maybe String # getUniversalName :: XNode -> Maybe String # getUniversalUri :: XNode -> Maybe String # getLocalPart :: XNode -> Maybe String # getNamePrefix :: XNode -> Maybe String # getNamespaceUri :: XNode -> Maybe String # changeText :: (String -> String) -> XNode -> XNode # changeBlob :: (Blob -> Blob) -> XNode -> XNode # changeCmt :: (String -> String) -> XNode -> XNode # changeName :: (QName -> QName) -> XNode -> XNode # changeElemName :: (QName -> QName) -> XNode -> XNode # changeAttrl :: (XmlTrees -> XmlTrees) -> XNode -> XNode # changeAttrName :: (QName -> QName) -> XNode -> XNode # changePiName :: (QName -> QName) -> XNode -> XNode # changeDTDAttrl :: (Attributes -> Attributes) -> XNode -> XNode # setText :: String -> XNode -> XNode # setBlob :: Blob -> XNode -> XNode # setCmt :: String -> XNode -> XNode # setName :: QName -> XNode -> XNode # setElemName :: QName -> XNode -> XNode # setElemAttrl :: XmlTrees -> XNode -> XNode # setAttrName :: QName -> XNode -> XNode # setPiName :: QName -> XNode -> XNode # setDTDAttrl :: Attributes -> XNode -> XNode #

type XmlTrees = NTrees XNode #

List of rose trees with XML nodes

type XmlNavTree = NTZipper XNode #

Navigatable rose tree with XML nodes

type XmlNavTrees = [NTZipper XNode] #

List of navigatable rose trees with XML nodes

type Blob = ByteString #

Binary large object implemented as a lazy bytestring

data DTDElem #

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: "#REQUIRED" | "#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

Binary DTDElem # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods put :: DTDElem -> Put # get :: Get DTDElem # putList :: [DTDElem] -> Put #
NFData DTDElem # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods rnf :: DTDElem -> () #
Enum DTDElem # |
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] #
Read DTDElem # |
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 # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods showsPrec :: Int -> DTDElem -> ShowS # show :: DTDElem -> String # showList :: [DTDElem] -> ShowS #
Eq DTDElem # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods (==) :: DTDElem -> DTDElem -> Bool # (/=) :: DTDElem -> DTDElem -> Bool #
Ord DTDElem # |
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 #
WNFData DTDElem # |
Instance details Defined in Text.XML.HXT.DOM.TypeDefs Methods rwnf :: DTDElem -> () # rwnf2 :: DTDElem -> () #

type Attributes = AssocList String String #

Attribute list

used for storing option lists and features of DTD parts

rwnfAttributes :: Attributes -> () #

Evaluate an assoc list of strings

blobToString :: Blob -> String #

stringToBlob :: String -> Blob #

c_ok :: Int #

no error, everything is ok

c_warn :: Int #

Error level for XError, type warning

c_err :: Int #

Error level for XError, type error

c_fatal :: Int #

Error level for XError, type fatal error

data XmlNodeSet #

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

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

type ChildNodes = [(Int, XmlNodeSet)] #

module Text.XML.HXT.DOM.QualifiedName