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

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

Text.XML.HXT.XPath.XPathFct

Description

The module contains the core-functions of the XPath function library. All functions are implemented as XFct. Each XFct contains the evaluation context, the variable environment and the function arguments.

Synopsis

Documentation

type XFct = Context -> Env -> [XPathValue] -> XPathValueSource

Type signature for all functions which can be used in the XPath module.

evalFct :: FctName -> Env -> Context -> [XPathValue] -> XPathValueSource

Evaluates a function. Calculation of the function value is done by looking up the function name in the function table, check the number of arguments and calculate the funtion, if no argument evaluation returns an error.

toXValue :: XFct -> Context -> Env -> [XPathValue] -> [XPathValue]Source

Converts a list of different XPathValue types in a list of one XPathValue type.

  • 1.parameter fct : the conversion function

xnumber :: XFctSource

number number(object?): converts its argument to a number

xboolean :: XFctSource

boolean boolean(object): converts its argument to a boolean value

xstring :: XFctSource

string string(object?): converts an object to a string

getConvFct :: XPathValue -> Maybe XFctSource

Returns the conversion function for the XPath results: string, boolean and number A nodeset can not be converted.

stringValue :: NavXmlTree -> XPathValueSource

Returns the string-value of a node, the value of a namespace node is not supported

isNotInNodeList :: NavXmlTree -> [NavXmlTree] -> BoolSource

Check whether a node is not a part of a node list. Needed to implement matching & testing in xslt.

getVarTab :: Env -> VarTabSource

Returns the table of variables from the environment

getKeyTab :: Env -> KeyTabSource

Returns the table of keys, needed by xslt, from the environment