hxt-xpath-9.1.0: The XPath modules for HXT.

Portabilityportable
Stabilityexperimental
MaintainerUwe Schmidt (uwe@fh-wedel.de)

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

Documentation

data Expr Source

Represents expression

Constructors

GenExpr Op [Expr]

generic expression with an operator and one or more operands

PathExpr (Maybe Expr) (Maybe LocationPath)

a 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 VarName

variable

LiteralExpr Literal

string

NumberExpr XPNumber

number

FctExpr FctName FctArguments

a function with a name and an optional list of arguments

Instances

data Op Source

Represents XPath operators

Instances

data XPNumber Source

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 Float

floating-point number

NaN

not-a-number

NegInf

negative infinity

Neg0

negative zero

Pos0

positive zero

PosInf

positive infinity

data LocationPath Source

Represents location path

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

Constructors

LocPath Path [XStep] 

data Path Source

A location path is either a relative or an absolute path.

Constructors

Rel 
Abs 

Instances

data XStep Source

Represents location step

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

Constructors

Step AxisSpec NodeTest [Expr] 

Instances

data NodeTest Source

Represents XPath node-tests

Constructors

NameTest QName

name-test

PI String

processing-instruction-test with a literal argument

TypeTest XPathNode

all nodetype-tests

Instances

data XPathNode Source

Represents nodetype-tests

Constructors

XPNode

all 7 nodetypes (root, element, attribute, namespace, pi, comment, text)

XPCommentNode

comment-nodes

XPPINode

processing-instruction-nodes

XPTextNode

text-nodes: cdata, character data

type VarName = NameSource

Variable name

type Literal = StringSource

a string

type FctName = StringSource

Function name

type FctArguments = [Expr]Source

Function arguments

type Context = (ConPos, ConLen, ConNode)Source

Evaluation context

type ConPos = IntSource

Context position

type ConLen = IntSource

Context length

type ConNode = NavXmlTreeSource

Context node

data XPathValue Source

Represents XPath results

Constructors

XPVNode NodeSet

node-set

XPVBool Bool

boolean value

XPVNumber XPNumber

number according the IEEE 754 standard

XPVString String

string value

XPVError String

error message with text

type NavXmlTree = NavTree XNodeSource

Node of navigable tree representation

type NavXmlTrees = [NavXmlTree]Source

List of nodes of navigable tree representation

newtype NodeSet Source

Set of navigable trees identified by their document position (NodePath)

Constructors

NS 

type NodePath = [Int]Source

path represented as list of indices starting at root

type XPathFilter = XPathValue -> XPathValueSource

A functions that takes a XPath result and returns a XPath result

emptyNodeSet :: NodeSetSource

node set functions

type VarTab = [(VarName, XPathValue)]Source

XPath environment

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