hxt-7.5: A collection of tools for processing XML with Haskell.ContentsIndex
Text.XML.HXT.XPath.XPathDataTypes
Description
The core data types of XPath. The Type NodeSet is based on the module NavTree which was adapted from HXML (http://www.flightlab.com/~joe/hxml/)
Synopsis
data Expr
= GenExpr Op [Expr]
| PathExpr Maybe Expr Maybe LocationPath
| FilterExpr [Expr]
| VarExpr VarName
| LiteralExpr Literal
| NumberExpr XPNumber
| FctExpr FctName FctArguments
data Op
= Or
| And
| Eq
| NEq
| Less
| Greater
| LessEq
| GreaterEq
| Plus
| Minus
| Div
| Mod
| Mult
| Unary
| Union
data XPNumber
= Float Float
| NaN
| NegInf
| Neg0
| Pos0
| PosInf
data LocationPath = LocPath Path [XStep]
data Path
= Rel
| Abs
data XStep = Step AxisSpec NodeTest [Expr]
data AxisSpec
= Ancestor
| AncestorOrSelf
| Attribute
| Child
| Descendant
| DescendantOrSelf
| Following
| FollowingSibling
| Namespace
| Parent
| Preceding
| PrecedingSibling
| Self
data NodeTest
= NameTest QName
| PI String
| TypeTest XPathNode
data XPathNode
= XPNode
| XPCommentNode
| XPPINode
| XPTextNode
type Name = (NamePrefix, LocalName)
type NamePrefix = String
type LocalName = String
type VarName = Name
type Literal = String
type FctName = String
type FctArguments = [Expr]
type Context = (ConPos, ConLen, ConNode)
type ConPos = Int
type ConLen = Int
type ConNode = NavXmlTree
data XPathValue
= XPVNode NodeSet
| XPVBool Bool
| XPVNumber XPNumber
| XPVString String
| XPVError String
type NavXmlTree = NavTree XNode
type NavXmlTrees = [NavXmlTree]
type NodeSet = NavXmlTrees
type XPathFilter = XPathValue -> XPathValue
type VarTab = [(VarName, XPathValue)]
type KeyTab = [(QName, String, NavXmlTree)]
type Env = (VarTab, KeyTab)
varEnv :: Env
module Text.XML.HXT.XPath.NavTree
Documentation
data Expr
Represents expression
Constructors
GenExpr Op [Expr]generic expression with an operator and one or more operands
PathExpr Maybe Expr Maybe LocationPatha path expression contains an optional filter-expression or an optional locationpath. one expression is urgently necessary, both are possible
FilterExpr [Expr]filter-expression with zero or more predicates
VarExpr VarNamevariable
LiteralExpr Literalstring
NumberExpr XPNumbernumber
FctExpr FctName FctArgumentsa function with a name and an optional list of arguments
show/hide Instances
data Op
Represents XPath operators
Constructors
Or
And
Eq
NEq
Less
Greater
LessEq
GreaterEq
Plus
Minus
Div
Mod
Mult
Unary
Union
show/hide Instances
data XPNumber

Represents a floating-point number according the IEEE 754 standard

The standard includes a special Not-a-Number (NaN) value, positive and negative infinity, positive and negative zero.

Constructors
Float Floatfloating-point number
NaNnot-a-number
NegInfnegative infinity
Neg0negative zero
Pos0positive zero
PosInfpositive infinity
show/hide Instances
data LocationPath

Represents location path

A location path consists of a sequence of one or more location steps.

Constructors
LocPath Path [XStep]
show/hide Instances
data Path
A location path is either a relative or an absolute path.
Constructors
Rel
Abs
show/hide Instances
data XStep

Represents location step

A location step consists of an axis, a node-test and zero or more predicates.

Constructors
Step AxisSpec NodeTest [Expr]
show/hide Instances
data AxisSpec
Represents XPath axis
Constructors
Ancestor
AncestorOrSelf
Attribute
Child
Descendant
DescendantOrSelf
Following
FollowingSibling
Namespace
Parent
Preceding
PrecedingSibling
Self
show/hide Instances
data NodeTest
Represents XPath node-tests
Constructors
NameTest QNamename-test
PI Stringprocessing-instruction-test with a literal argument
TypeTest XPathNodeall nodetype-tests
show/hide Instances
data XPathNode
Represents nodetype-tests
Constructors
XPNodeall 7 nodetypes (root, element, attribute, namespace, pi, comment, text)
XPCommentNodecomment-nodes
XPPINodeprocessing-instruction-nodes
XPTextNodetext-nodes: cdata, character data
show/hide Instances
type Name = (NamePrefix, LocalName)
type NamePrefix = String
type LocalName = String
type VarName = Name
Variable name
type Literal = String
a string
type FctName = String
Function name
type FctArguments = [Expr]
Function arguments
type Context = (ConPos, ConLen, ConNode)
Evaluation context
type ConPos = Int
Context position
type ConLen = Int
Context length
type ConNode = NavXmlTree
Context node
data XPathValue
Represents XPath results
Constructors
XPVNode NodeSetnode-set
XPVBool Boolboolean value
XPVNumber XPNumbernumber according the IEEE 754 standard
XPVString Stringstring value
XPVError Stringerror message with text
show/hide Instances
type NavXmlTree = NavTree XNode
Node of navigable tree representation
type NavXmlTrees = [NavXmlTree]
List of nodes of navigable tree representation
type NodeSet = NavXmlTrees
Type synonym for a list of navigable tree representation
type XPathFilter = XPathValue -> XPathValue
A functions that takes a XPath result and returns a XPath result
type VarTab = [(VarName, XPathValue)]

XPath environment

All variables are stored in the environment, each variable name is bound to a value.

type KeyTab = [(QName, String, NavXmlTree)]
type Env = (VarTab, KeyTab)
varEnv :: Env
module Text.XML.HXT.XPath.NavTree
Produced by Haddock version 2.1.0