hxt-xpath-9.1.2.2: The XPath modules for HXT.
CopyrightCopyright (C) 2006 Uwe Schmidt
LicenseMIT
MaintainerUwe Schmidt (uwe@fh-wedel.de)
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell98

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 AxisSpec Source #

Represents XPath axis

Instances

Instances details
Show AxisSpec Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

showsPrec :: Int -> AxisSpec -> ShowS

show :: AxisSpec -> String

showList :: [AxisSpec] -> ShowS

Eq AxisSpec Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

(==) :: AxisSpec -> AxisSpec -> Bool

(/=) :: AxisSpec -> AxisSpec -> Bool

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

Instances

Instances details
Show XPNumber Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

showsPrec :: Int -> XPNumber -> ShowS

show :: XPNumber -> String

showList :: [XPNumber] -> ShowS

Eq XPNumber Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

(==) :: XPNumber -> XPNumber -> Bool

(/=) :: XPNumber -> XPNumber -> Bool

Ord XPNumber Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

compare :: XPNumber -> XPNumber -> Ordering

(<) :: XPNumber -> XPNumber -> Bool

(<=) :: XPNumber -> XPNumber -> Bool

(>) :: XPNumber -> XPNumber -> Bool

(>=) :: XPNumber -> XPNumber -> Bool

max :: XPNumber -> XPNumber -> XPNumber

min :: XPNumber -> XPNumber -> XPNumber

newtype NodeSet Source #

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

Constructors

NS 

Fields

Instances

Instances details
Show NodeSet Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

showsPrec :: Int -> NodeSet -> ShowS

show :: NodeSet -> String

showList :: [NodeSet] -> ShowS

Eq NodeSet Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

(==) :: NodeSet -> NodeSet -> Bool

(/=) :: NodeSet -> NodeSet -> Bool

Ord NodeSet Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

compare :: NodeSet -> NodeSet -> Ordering

(<) :: NodeSet -> NodeSet -> Bool

(<=) :: NodeSet -> NodeSet -> Bool

(>) :: NodeSet -> NodeSet -> Bool

(>=) :: NodeSet -> NodeSet -> Bool

max :: NodeSet -> NodeSet -> NodeSet

min :: NodeSet -> NodeSet -> NodeSet

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

Instances details
Show Expr Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

showsPrec :: Int -> Expr -> ShowS

show :: Expr -> String

showList :: [Expr] -> ShowS

Eq Expr Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

(==) :: Expr -> Expr -> Bool

(/=) :: Expr -> Expr -> Bool

data Op Source #

Represents XPath operators

Instances

Instances details
Show Op Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

showsPrec :: Int -> Op -> ShowS

show :: Op -> String

showList :: [Op] -> ShowS

Eq Op Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

(==) :: Op -> Op -> Bool

(/=) :: Op -> Op -> Bool

data LocationPath Source #

Represents location path

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

Constructors

LocPath Path [XStep] 

Instances

Instances details
Show LocationPath Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

showsPrec :: Int -> LocationPath -> ShowS

show :: LocationPath -> String

showList :: [LocationPath] -> ShowS

Eq LocationPath Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

(==) :: LocationPath -> LocationPath -> Bool

(/=) :: LocationPath -> LocationPath -> Bool

type VarName = Name Source #

Variable name

type Literal = String Source #

a string

type FctName = String Source #

Function name

type FctArguments = [Expr] Source #

Function arguments

data Path Source #

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

Constructors

Rel 
Abs 

Instances

Instances details
Show Path Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

showsPrec :: Int -> Path -> ShowS

show :: Path -> String

showList :: [Path] -> ShowS

Eq Path Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

(==) :: Path -> Path -> Bool

(/=) :: Path -> Path -> Bool

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

Instances details
Show XStep Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

showsPrec :: Int -> XStep -> ShowS

show :: XStep -> String

showList :: [XStep] -> ShowS

Eq XStep Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

(==) :: XStep -> XStep -> Bool

(/=) :: XStep -> XStep -> Bool

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

Instances details
Show NodeTest Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

showsPrec :: Int -> NodeTest -> ShowS

show :: NodeTest -> String

showList :: [NodeTest] -> ShowS

Eq NodeTest Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

(==) :: NodeTest -> NodeTest -> Bool

(/=) :: NodeTest -> NodeTest -> Bool

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

Instances

Instances details
Show XPathNode Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

showsPrec :: Int -> XPathNode -> ShowS

show :: XPathNode -> String

showList :: [XPathNode] -> ShowS

Eq XPathNode Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

(==) :: XPathNode -> XPathNode -> Bool

(/=) :: XPathNode -> XPathNode -> Bool

type NamePrefix = String Source #

type LocalName = String Source #

type Context = (ConPos, ConLen, ConNode) Source #

Evaluation context

type ConPos = Int Source #

Context position

type ConLen = Int Source #

Context length

type ConNode = NavXmlTree Source #

Context node

type NavXmlTree = NavTree XNode Source #

Node of navigable tree representation

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

Instances

Instances details
Show XPathValue Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

showsPrec :: Int -> XPathValue -> ShowS

show :: XPathValue -> String

showList :: [XPathValue] -> ShowS

Eq XPathValue Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

Methods

(==) :: XPathValue -> XPathValue -> Bool

(/=) :: XPathValue -> XPathValue -> Bool

Ord XPathValue Source # 
Instance details

Defined in Text.XML.HXT.XPath.XPathDataTypes

type NavXmlTrees = [NavXmlTree] Source #

List of nodes of navigable tree representation

type NodePath = [Int] Source #

path represented as list of indices starting at root

type XPathFilter = XPathValue -> XPathValue Source #

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

emptyNodeSet :: NodeSet Source #

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.

type KeyTab = [(QName, String, NavXmlTree)] Source #