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

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

Text.XML.HXT.DOM.XmlNode

Description

Interface for XmlArrow to basic data types NTree and XmlTree

If this module must be used in code working with arrows, it should be imported qualified e.g. `as XN`, to prevent name clashes.

For code working on the "node and tree level" this module is the interface for writing code without using the constructor functions of `XNode` and `NTree` directly

Synopsis

- class XmlNode a where
  - isText :: a -> Bool
  - isBlob :: a -> Bool
  - isCharRef :: a -> Bool
  - isEntityRef :: a -> Bool
  - isCmt :: a -> Bool
  - isCdata :: a -> Bool
  - isPi :: a -> Bool
  - isElem :: a -> Bool
  - isRoot :: a -> Bool
  - isDTD :: a -> Bool
  - isAttr :: a -> Bool
  - isError :: a -> Bool
  - mkText :: String -> a
  - mkBlob :: Blob -> a
  - mkCharRef :: Int -> a
  - mkEntityRef :: String -> a
  - mkCmt :: String -> a
  - mkCdata :: String -> a
  - mkPi :: QName -> XmlTrees -> a
  - mkError :: Int -> String -> a
  - getText :: a -> Maybe String
  - getBlob :: a -> Maybe Blob
  - getCharRef :: a -> Maybe Int
  - getEntityRef :: a -> Maybe String
  - getCmt :: a -> Maybe String
  - getCdata :: a -> Maybe String
  - getPiName :: a -> Maybe QName
  - getPiContent :: a -> Maybe XmlTrees
  - getElemName :: a -> Maybe QName
  - getAttrl :: a -> Maybe XmlTrees
  - getDTDPart :: a -> Maybe DTDElem
  - getDTDAttrl :: a -> Maybe Attributes
  - getAttrName :: a -> Maybe QName
  - getErrorLevel :: a -> Maybe Int
  - getErrorMsg :: a -> Maybe String
  - getName :: a -> Maybe QName
  - getQualifiedName :: a -> Maybe String
  - getUniversalName :: a -> Maybe String
  - getUniversalUri :: a -> Maybe String
  - getLocalPart :: a -> Maybe String
  - getNamePrefix :: a -> Maybe String
  - getNamespaceUri :: a -> Maybe String
  - changeText :: (String -> String) -> a -> a
  - changeBlob :: (Blob -> Blob) -> a -> a
  - changeCmt :: (String -> String) -> a -> a
  - changeName :: (QName -> QName) -> a -> a
  - changeElemName :: (QName -> QName) -> a -> a
  - changeAttrl :: (XmlTrees -> XmlTrees) -> a -> a
  - changeAttrName :: (QName -> QName) -> a -> a
  - changePiName :: (QName -> QName) -> a -> a
  - changeDTDAttrl :: (Attributes -> Attributes) -> a -> a
  - setText :: String -> a -> a
  - setBlob :: Blob -> a -> a
  - setCmt :: String -> a -> a
  - setName :: QName -> a -> a
  - setElemName :: QName -> a -> a
  - setElemAttrl :: XmlTrees -> a -> a
  - setAttrName :: QName -> a -> a
  - setPiName :: QName -> a -> a
  - setDTDAttrl :: Attributes -> a -> a
- mkElementNode :: QName -> XmlTrees -> XNode
- mkAttrNode :: QName -> XNode
- mkDTDNode :: DTDElem -> Attributes -> XNode
- mkElement :: QName -> XmlTrees -> XmlTrees -> XmlTree
- mkRoot :: XmlTrees -> XmlTrees -> XmlTree
- mkAttr :: QName -> XmlTrees -> XmlTree
- mkDTDElem :: DTDElem -> Attributes -> XmlTrees -> XmlTree
- addAttr :: XmlTree -> XmlTrees -> XmlTrees
- mergeAttrl :: XmlTrees -> XmlTrees -> XmlTrees
- mkElement' :: QName -> XmlTrees -> XmlTrees -> XmlTree
- mkRoot' :: XmlTrees -> XmlTrees -> XmlTree
- mkAttr' :: QName -> XmlTrees -> XmlTree
- mkText' :: String -> XmlTree
- mkCharRef' :: Int -> XmlTree
- mkEntityRef' :: String -> XmlTree
- mkCmt' :: String -> XmlTree
- mkCdata' :: String -> XmlTree
- mkPi' :: QName -> XmlTrees -> XmlTree
- mkError' :: Int -> String -> XmlTree
- mkDTDElem' :: DTDElem -> Attributes -> XmlTrees -> XmlTree
- toText :: XmlTree -> XmlTree
- concText :: XmlTree -> XmlTree -> XmlTrees
- mergeText :: XmlTree -> XmlTree -> XmlTrees
- module Data.Tree.Class
- module Data.Tree.NTree.TypeDefs

# Documentation

class XmlNode a where Source

Minimal complete definition

isText, isBlob, isCharRef, isEntityRef, isCmt, isCdata, isPi, isElem, isRoot, isDTD, isAttr, isError, mkText, mkBlob, mkCharRef, mkEntityRef, mkCmt, mkCdata, mkPi, mkError, getText, getBlob, getCharRef, getEntityRef, getCmt, getCdata, getPiName, getPiContent, getElemName, getAttrl, getDTDPart, getDTDAttrl, getAttrName, getErrorLevel, getErrorMsg, changeText, changeBlob, changeCmt, changeName, changeElemName, changeAttrl, changeAttrName, changePiName, changeDTDAttrl

Methods

isText :: a -> Bool Source

isBlob :: a -> Bool Source

isCharRef :: a -> Bool Source

isEntityRef :: a -> Bool Source

isCmt :: a -> Bool Source

isCdata :: a -> Bool Source

isPi :: a -> Bool Source

isElem :: a -> Bool Source

isRoot :: a -> Bool Source

isDTD :: a -> Bool Source

isAttr :: a -> Bool Source

isError :: a -> Bool Source

mkText :: String -> a Source

mkBlob :: Blob -> a Source

mkCharRef :: Int -> a Source

mkEntityRef :: String -> a Source

mkCmt :: String -> a Source

mkCdata :: String -> a Source

mkPi :: QName -> XmlTrees -> a Source

mkError :: Int -> String -> a Source

getText :: a -> Maybe String Source

getBlob :: a -> Maybe Blob Source

getCharRef :: a -> Maybe Int Source

getEntityRef :: a -> Maybe String Source

getCmt :: a -> Maybe String Source

getCdata :: a -> Maybe String Source

getPiName :: a -> Maybe QName Source

getPiContent :: a -> Maybe XmlTrees Source

getElemName :: a -> Maybe QName Source

getAttrl :: a -> Maybe XmlTrees Source

getDTDPart :: a -> Maybe DTDElem Source

getDTDAttrl :: a -> Maybe Attributes Source

getAttrName :: a -> Maybe QName Source

getErrorLevel :: a -> Maybe Int Source

getErrorMsg :: a -> Maybe String Source

getName :: a -> Maybe QName Source

getQualifiedName :: a -> Maybe String Source

getUniversalName :: a -> Maybe String Source

getUniversalUri :: a -> Maybe String Source

getLocalPart :: a -> Maybe String Source

getNamePrefix :: a -> Maybe String Source

getNamespaceUri :: a -> Maybe String Source

changeText :: (String -> String) -> a -> a Source

changeBlob :: (Blob -> Blob) -> a -> a Source

changeCmt :: (String -> String) -> a -> a Source

changeName :: (QName -> QName) -> a -> a Source

changeElemName :: (QName -> QName) -> a -> a Source

changeAttrl :: (XmlTrees -> XmlTrees) -> a -> a Source

changeAttrName :: (QName -> QName) -> a -> a Source

changePiName :: (QName -> QName) -> a -> a Source

changeDTDAttrl :: (Attributes -> Attributes) -> a -> a Source

setText :: String -> a -> a Source

setBlob :: Blob -> a -> a Source

setCmt :: String -> a -> a Source

setName :: QName -> a -> a Source

setElemName :: QName -> a -> a Source

setElemAttrl :: XmlTrees -> a -> a Source

setAttrName :: QName -> a -> a Source

setPiName :: QName -> a -> a Source

setDTDAttrl :: Attributes -> a -> a Source

Instances

XmlNode XNode Source |
(XmlNode a, Tree t) => XmlNode (t a) Source |

mkElementNode :: QName -> XmlTrees -> XNode Source

mkAttrNode :: QName -> XNode Source

mkDTDNode :: DTDElem -> Attributes -> XNode Source

mkElement :: QName -> XmlTrees -> XmlTrees -> XmlTree Source

mkRoot :: XmlTrees -> XmlTrees -> XmlTree Source

mkAttr :: QName -> XmlTrees -> XmlTree Source

mkDTDElem :: DTDElem -> Attributes -> XmlTrees -> XmlTree Source

addAttr :: XmlTree -> XmlTrees -> XmlTrees Source

mergeAttrl :: XmlTrees -> XmlTrees -> XmlTrees Source

mkElement' :: QName -> XmlTrees -> XmlTrees -> XmlTree Source

weak normalform versions of constructors

mkRoot' :: XmlTrees -> XmlTrees -> XmlTree Source

mkAttr' :: QName -> XmlTrees -> XmlTree Source

mkText' :: String -> XmlTree Source

mkCharRef' :: Int -> XmlTree Source

mkEntityRef' :: String -> XmlTree Source

mkCmt' :: String -> XmlTree Source

mkCdata' :: String -> XmlTree Source

mkPi' :: QName -> XmlTrees -> XmlTree Source

mkError' :: Int -> String -> XmlTree Source

mkDTDElem' :: DTDElem -> Attributes -> XmlTrees -> XmlTree Source

toText :: XmlTree -> XmlTree Source

concText :: XmlTree -> XmlTree -> XmlTrees Source

mergeText :: XmlTree -> XmlTree -> XmlTrees Source

module Data.Tree.Class

module Data.Tree.NTree.TypeDefs