hxt-7.1: A collection of tools for processing XML with Haskell.ContentsIndex
Text.XML.HXT.DOM.XmlTreeFunctions
Description

basic XmlTree functions

Version : $Id: XmlTreeFunctions.hs,v 1.4 20061112 14:53:00 hxml Exp $

Synopsis
isXCdataNode :: XNode -> Bool
isXCharRefNode :: XNode -> Bool
isXCmtNode :: XNode -> Bool
isXDTDNode :: XNode -> Bool
isXAttrNode :: XNode -> Bool
isXEntityRefNode :: XNode -> Bool
isXErrorNode :: XNode -> Bool
isXPiNode :: XNode -> Bool
isXTagNode :: XNode -> Bool
isXTextNode :: XNode -> Bool
isRootNode :: XNode -> Bool
isTagNode :: String -> XNode -> Bool
isOfTagNode :: (TagName -> Bool) -> XNode -> Bool
isAttrNode :: String -> XNode -> Bool
isOfAttrNode :: (AttrName -> Bool) -> XNode -> Bool
isTextNode :: String -> XNode -> Bool
isOfTextNode :: (String -> Bool) -> XNode -> Bool
isPiNode :: String -> XNode -> Bool
isOfPiNode :: (TagName -> Bool) -> XNode -> Bool
isDTDElemNode :: DTDElem -> XNode -> Bool
isErrorNode :: Int -> XNode -> Bool
mkXTagTree :: String -> XmlTrees -> XmlTrees -> XmlTree
mkQTagTree :: QName -> XmlTrees -> XmlTrees -> XmlTree
mkXNsTagTree :: String -> String -> XmlTrees -> XmlTrees -> XmlTree
newRoot :: XmlTrees -> XmlTree
emptyRoot :: XmlTree
newDocument :: String -> XmlTree
newDocument' :: Attributes -> XmlTree
mkRootTree :: XmlTrees -> XmlTrees -> XmlTree
mkXTextTree :: String -> XmlTree
mkXCharRefTree :: Int -> XmlTree
mkXEntityRefTree :: String -> XmlTree
mkXCmtTree :: String -> XmlTree
mkXDTDTree :: DTDElem -> Attributes -> XmlTrees -> XmlTree
mkXAttrTree :: String -> XmlTrees -> XmlTree
mkQAttrTree :: QName -> XmlTrees -> XmlTree
mkXNsAttrTree :: String -> String -> XmlTrees -> XmlTree
mkXPERefTree :: String -> XmlTree
mkXPiTree :: String -> String -> XmlTree
mkXmlDeclTree :: XmlTrees -> XmlTree
mkXCdataTree :: String -> XmlTree
mkXErrorTree :: Int -> String -> XmlTrees -> XmlTree
maybeString2XText :: Maybe String -> XmlTrees
showXText :: XmlTrees -> String
showXCharRef :: XmlTrees -> String
showXEntityRef :: XmlTrees -> String
showXErrors :: XmlTrees -> String
xshow :: XmlTrees -> String
xmlTreesToString :: XmlTrees -> String
xmlTreesToText :: XmlSFilter
xmlContentModelToString :: XmlTree -> String
showXmlTree :: XmlTree -> String -> String
showXmlTrees :: XmlTrees -> String -> String
showXmlTrees' :: XmlTrees -> String -> String
showQName :: QName -> String -> String
showQuoteString :: String -> String -> String
showAttr :: String -> Attributes -> String -> String
showPEAttr :: Attributes -> String -> String
showExternalId :: Attributes -> String -> String
showNData :: Attributes -> String -> String
showXmlDTD :: DTDElem -> Attributes -> XmlTrees -> String -> String
showElemType :: String -> XmlTrees -> String -> String
showContent :: XmlTree -> String -> String
showEntity :: String -> Attributes -> XmlTrees -> String -> String
showEntityValue :: XmlTrees -> String -> String
showBlank :: String -> String
showEq :: String -> String
showLt :: String -> String
showGt :: String -> String
showSlash :: String -> String
showApos :: String -> String
showQuot :: String -> String
showLpar :: String -> String
showRpar :: String -> String
showNL :: String -> String
nameOf :: XmlTree -> String
localPartOf :: XmlTree -> String
namespaceOf :: XmlTree -> String
prefixOf :: XmlTree -> String
universalNameOf :: XmlTree -> String
attrlOfDTD :: XmlTree -> Attributes
valueOfDTD :: String -> XmlTree -> String
ofDTDequals :: String -> String -> XmlTree -> Bool
xcmt :: String -> XmlTrees
xerr :: String -> XmlTrees
xwarn :: String -> XmlTrees
xtext :: String -> XmlTrees
xtag :: String -> XmlTrees -> XmlTrees -> XmlTrees
xattr :: String -> String -> XmlTrees
toTreel :: XmlTrees -> AssocList String XmlTrees
toAttrl :: XmlTrees -> Attributes
fromTreel :: AssocList String XmlTrees -> XmlTrees
fromAttrl :: Attributes -> XmlTrees
Documentation
isXCdataNode :: XNode -> Bool
isXCharRefNode :: XNode -> Bool
isXCmtNode :: XNode -> Bool
isXDTDNode :: XNode -> Bool
isXAttrNode :: XNode -> Bool
isXEntityRefNode :: XNode -> Bool
isXErrorNode :: XNode -> Bool
isXPiNode :: XNode -> Bool
isXTagNode :: XNode -> Bool
isXTextNode :: XNode -> Bool
isRootNode :: XNode -> Bool
isTagNode :: String -> XNode -> Bool
isOfTagNode :: (TagName -> Bool) -> XNode -> Bool
isAttrNode :: String -> XNode -> Bool
isOfAttrNode :: (AttrName -> Bool) -> XNode -> Bool
isTextNode :: String -> XNode -> Bool
isOfTextNode :: (String -> Bool) -> XNode -> Bool
isPiNode :: String -> XNode -> Bool
isOfPiNode :: (TagName -> Bool) -> XNode -> Bool
isDTDElemNode :: DTDElem -> XNode -> Bool
isErrorNode :: Int -> XNode -> Bool
mkXTagTree :: String -> XmlTrees -> XmlTrees -> XmlTree

Create a tree with a tag node.

  • 1.parameter n : the name of the tag
  • 2.parameter al : the tag attribte list
  • 3.parameter cs : the list of children
  • returns : the new tree
mkQTagTree :: QName -> XmlTrees -> XmlTrees -> XmlTree
Version with qualified name of mkXTagTree
mkXNsTagTree :: String -> String -> XmlTrees -> XmlTrees -> XmlTree

create a tree with a namespace aware tag node.

  • 1.parameter n : the prefix:localpart of the tag
  • 2.parameter ns: the namespace uri
  • 3.parameter al : the tag attribte list
  • 4.parameter cs : the list of children
  • returns : the new tree

see also: mkXTagTree

newRoot :: XmlTrees -> XmlTree

creates a new document tree with empty contents.

  • 1.parameter al : the attribute list for the root node

returns a single node tree with tag name "/" indicating a root and with empty list of children

see also : emptyRoot

emptyRoot :: XmlTree

the empty document tree

see also : newRoot

newDocument :: String -> XmlTree
create a new empty document with source name as parameter
newDocument' :: Attributes -> XmlTree

create a new empty document with a list of attributes for source location and options

see also : newDocument

mkRootTree :: XmlTrees -> XmlTrees -> XmlTree

create a document root tree.

  • 1.parameter al : the attribute list for the root. This list must contain at least an attribute "source" that contains the URI of the document to be processed
  • 2.parameter cs : the list for the document content
  • returns : the document root
mkXTextTree :: String -> XmlTree

create a leaf for a text element.

  • 1.parameter txt : the text
  • returns : the tree with the single node containing the text
mkXCharRefTree :: Int -> XmlTree

create a leaf for a char reference.

  • 1.parameter i : the integer representing the Unicode char
  • returns : the tree with the single node containing the char reference
mkXEntityRefTree :: String -> XmlTree

create a leaf for an entity reference.

  • 1.parameter n : the name of the entity reference
  • returns : the tree with the single node containing the entity reference
mkXCmtTree :: String -> XmlTree

create a leaf for a comment,

  • 1.parameter c : the comment text
  • returns : the tree with the single node containing the comment
mkXDTDTree :: DTDElem -> Attributes -> XmlTrees -> XmlTree

create a tree for a part of a DTD

  • 1.parameter d : the type of the DTD part
  • 2.parameter al : the attribute list for the DTD part
  • 3.parameter ds : the possibly empty list of components for the DTD part
  • returns : the tree with the composed DTD part
mkXAttrTree :: String -> XmlTrees -> XmlTree

create an attribute tree as part of a tag attribute list of tag nodes

  • 1.parameter al : the attribute name
  • 2.parameter av : the attribute value as tree list, usually containing a single text node
mkQAttrTree :: QName -> XmlTrees -> XmlTree
Qualified version of mkXAttrTree
mkXNsAttrTree :: String -> String -> XmlTrees -> XmlTree

create an attribute tree with a namespace

  • 1.parameter al : the attribute name
  • 2.parameter ns : namespace uri
  • 3.parameter av : the attribute value as tree list, usually containing a single text node

see also: mkXAttrTree, mkXNsTagTree

mkXPERefTree :: String -> XmlTree

create a parameter entity reference DTD part.

  • 1.parameter ref : the name of the reference
  • returns : the DTD part for a PERef
mkXPiTree :: String -> String -> XmlTree

create a processing instruction tree.

  • 1.parameter n : the name of the PI
  • 2.parameter str : the content of a PI
  • returns : the processing instruction tree with a single attribute "value" with the str parameter as attribute value, with valueOf a_value applied to the result tree the content of the PI can be selected
mkXmlDeclTree :: XmlTrees -> XmlTree
create xml declaration
mkXCdataTree :: String -> XmlTree

create a CDATA section tree.

  • 1.parameter s : the content of the CDATA section
  • returns : the tree for the CDATA section
mkXErrorTree :: Int -> String -> XmlTrees -> XmlTree

create an error tree.

  • 1.parameter l : the level of the error (warning, error fatal)
  • 2.parameter msg : the error message
  • 3.parameter cs : the context, where the error was detected
maybeString2XText :: Maybe String -> XmlTrees
showXText :: XmlTrees -> String
showXCharRef :: XmlTrees -> String
showXEntityRef :: XmlTrees -> String
showXErrors :: XmlTrees -> String
xshow :: XmlTrees -> String

convert the result of a filter into a string

see also : xmlTreesToText for filter version, xread for the inverse operation

xmlTreesToString :: XmlTrees -> String
old name for xshow (deprecated)
xmlTreesToText :: XmlSFilter

conversion of a filter result into a text node

see also : xshow

xmlContentModelToString :: XmlTree -> String
showXmlTree :: XmlTree -> String -> String
showXmlTrees :: XmlTrees -> String -> String
showXmlTrees' :: XmlTrees -> String -> String
showQName :: QName -> String -> String
showQuoteString :: String -> String -> String
showAttr :: String -> Attributes -> String -> String
showPEAttr :: Attributes -> String -> String
showExternalId :: Attributes -> String -> String
showNData :: Attributes -> String -> String
showXmlDTD :: DTDElem -> Attributes -> XmlTrees -> String -> String
showElemType :: String -> XmlTrees -> String -> String
showContent :: XmlTree -> String -> String
showEntity :: String -> Attributes -> XmlTrees -> String -> String
showEntityValue :: XmlTrees -> String -> String
showBlank :: String -> String
showEq :: String -> String
showLt :: String -> String
showGt :: String -> String
showSlash :: String -> String
showApos :: String -> String
showQuot :: String -> String
showLpar :: String -> String
showRpar :: String -> String
showNL :: String -> String
nameOf :: XmlTree -> String
select the name of a node. For tags, attributes and pi's the name string is returned, else the empty string.
localPartOf :: XmlTree -> String
select the local part of a name of a node. For tags, attributes the name string is returned, for pi's the whole name, else the empty string.
namespaceOf :: XmlTree -> String
select the namespace URI of a tag or an attribute tree, else the empty string is returned see also : nameOf
prefixOf :: XmlTree -> String
select the namespace prefix of a tag or an attribute tree, else the empty string is returned see also : nameOf, localPartOf
universalNameOf :: XmlTree -> String
select the universal name (namespace uri ++ localPart) of a tag or an attribute tree, else the empty string is returned see also : nameOf, namespaceOf
attrlOfDTD :: XmlTree -> Attributes
select the attributes of a dtd tree
valueOfDTD :: String -> XmlTree -> String
select a special attribute of a DTD part
ofDTDequals :: String -> String -> XmlTree -> Bool
test an attribute of a DTD part
xcmt :: String -> XmlTrees
xerr :: String -> XmlTrees
xwarn :: String -> XmlTrees
xtext :: String -> XmlTrees
xtag :: String -> XmlTrees -> XmlTrees -> XmlTrees
xattr :: String -> String -> XmlTrees
toTreel :: XmlTrees -> AssocList String XmlTrees
toAttrl :: XmlTrees -> Attributes
fromTreel :: AssocList String XmlTrees -> XmlTrees
fromAttrl :: Attributes -> XmlTrees
Produced by Haddock version 0.8