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

Copyright | Copyright (C) 2008 Uwe Schmidt
License | MIT
Maintainer | Uwe Schmidt (uwe@fh-wedel.de)
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell98

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

- type XFct = Context -> Env -> [XPathValue] -> XPathValue
- evalFct :: FctName -> Env -> Context -> [XPathValue] -> XPathValue
- toXValue :: XFct -> Context -> Env -> [XPathValue] -> [XPathValue]
- xnumber :: XFct
- xboolean :: XFct
- xstring :: XFct
- getConvFct :: XPathValue -> Maybe XFct
- stringValue :: NavXmlTree -> XPathValue
- isNotInNodeList :: NavXmlTree -> [NavXmlTree] -> Bool
- getVarTab :: Env -> VarTab
- getKeyTab :: Env -> KeyTab

# Documentation

type XFct = Context -> Env -> [XPathValue] -> XPathValue Source #

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

evalFct :: FctName -> Env -> Context -> [XPathValue] -> XPathValue Source #

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.

- returns : the function value as `XPathValue`

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 :: XFct Source #

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

xboolean :: XFct Source #

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

xstring :: XFct Source #

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

getConvFct :: XPathValue -> Maybe XFct Source #

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

stringValue :: NavXmlTree -> XPathValue Source #

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

isNotInNodeList :: NavXmlTree -> [NavXmlTree] -> Bool Source #

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

getVarTab :: Env -> VarTab Source #

Returns the table of variables from the environment

getKeyTab :: Env -> KeyTab Source #

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