Copyright | Copyright (C) 2006 Uwe Schmidt |
---|---|
License | MIT |
Maintainer | Uwe Schmidt (uwe@fh-wedel.de) |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell98 |
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/)
- data Expr
- data Op
- data XPNumber
- data LocationPath = LocPath Path [XStep]
- data Path
- data XStep = Step AxisSpec NodeTest [Expr]
- data AxisSpec
- data NodeTest
- data XPathNode
- 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
- type NavXmlTree = NavTree XNode
- type NavXmlTrees = [NavXmlTree]
- newtype NodeSet = NS {}
- type NodePath = [Int]
- type XPathFilter = XPathValue -> XPathValue
- withXPVNode :: String -> (NodeSet -> XPathValue) -> XPathFilter
- emptyNodeSet :: NodeSet
- singletonNodeSet :: NavXmlTree -> NodeSet
- nullNodeSet :: NodeSet -> Bool
- cardNodeSet :: NodeSet -> Int
- deleteNodeSet :: NodePath -> NodeSet -> NodeSet
- insertNodeSet :: NavXmlTree -> NodeSet -> NodeSet
- unionNodeSet :: NodeSet -> NodeSet -> NodeSet
- unionsNodeSet :: [NodeSet] -> NodeSet
- elemsNodeSet :: NodeSet -> [(NodePath, NavXmlTree)]
- fromNodeSet :: NodeSet -> NavXmlTrees
- toNodeSet :: NavXmlTrees -> NodeSet
- headNodeSet :: NodeSet -> NavXmlTree
- withNodeSet :: (NavXmlTrees -> NavXmlTrees) -> NodeSet -> NodeSet
- type VarTab = [(VarName, XPathValue)]
- type KeyTab = [(QName, String, NavXmlTree)]
- type Env = (VarTab, KeyTab)
- varEnv :: Env
- module Text.XML.HXT.XPath.NavTree
Documentation
Represents expression
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 |
Represents XPath operators
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.
data LocationPath Source
Represents location path
A location path consists of a sequence of one or more location steps.
Represents location step
A location step consists of an axis, a node-test and zero or more predicates.
Represents XPath axis
Represents XPath node-tests
Represents nodetype-tests
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 Name = (NamePrefix, LocalName) Source
type NamePrefix = String Source
type FctArguments = [Expr] Source
Function arguments
type ConNode = NavXmlTree Source
Context node
data XPathValue Source
Represents XPath results
type NavXmlTree = NavTree XNode Source
Node of navigable tree representation
type NavXmlTrees = [NavXmlTree] Source
List of nodes of navigable tree representation
Set of navigable trees identified by their document position (NodePath)
type XPathFilter = XPathValue -> XPathValue Source
A functions that takes a XPath result and returns a XPath result
withXPVNode :: String -> (NodeSet -> XPathValue) -> XPathFilter Source
emptyNodeSet :: NodeSet Source
node set functions
nullNodeSet :: NodeSet -> Bool Source
cardNodeSet :: NodeSet -> Int Source
deleteNodeSet :: NodePath -> NodeSet -> NodeSet Source
insertNodeSet :: NavXmlTree -> NodeSet -> NodeSet Source
unionNodeSet :: NodeSet -> NodeSet -> NodeSet Source
unionsNodeSet :: [NodeSet] -> NodeSet Source
elemsNodeSet :: NodeSet -> [(NodePath, NavXmlTree)] Source
fromNodeSet :: NodeSet -> NavXmlTrees Source
toNodeSet :: NavXmlTrees -> NodeSet Source
headNodeSet :: NodeSet -> NavXmlTree Source
withNodeSet :: (NavXmlTrees -> NavXmlTrees) -> NodeSet -> NodeSet Source
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
module Text.XML.HXT.XPath.NavTree