Version: 1 Status: new User Page: index.html XML Definition: dyn.map.xml Function Package: dyn.map.zip Function Syntaxnode-set dyn:map(node-set, string)
The dyn:map function evaluates the expression passed as the second argument for each of the nodes passed as the first argument, and returns a node set of those values.
The expressions are evaluated relative to the nodes passed as the first argument. In other words, the value for each node is calculated by evaluating the XPath expression with all context information being the same as that for the call to the dyn:map function itself, except for the following:
- the context node is the node whose value is being calculated
- the context position is the position of the node within the node set passed as the first argument to the
dyn:map function, arranged in document order - the context size is the number of nodes passed as the first argument to the
dyn:map function
If the expression string passed as the second argument is an invalid XPath expression (including an empty string), this function returns an empty node set.
If the XPath expression evaluates as a node set, the dyn:map function returns the union of the node sets returned by evaluating the expression for each of the nodes in the first argument. Note that this may mean that the node set resulting from the call to the dyn:map function contains a different number of nodes from the number in the node set passed as the first argument to the function.
If the XPath expression evaluates as a number, the dyn:map function returns a node set containing one exsl:number element (namespace http://exslt.org/common ) for each node in the node set passed as the first argument to the dyn:map function, in document order. The string value of each exsl:number element is the same as the result of converting the number resulting from evaluating the expression to a string as with the number function, with the exception that Infinity results in an exsl:number holding the highest number the implementation can store, and -Infinity results in an exsl:number holding the lowest number the implementation can store.
If the XPath expression evaluates as a boolean, the dyn:map function returns a node set containing one exsl:boolean element (namespace http://exslt.org/common ) for each node in the node set passed as the first argument to the dyn:map function, in document order. The string value of each exsl:boolean element is 'true' if the expression evaluates as true for the node, and '' if the expression evaluates as false.
Otherwise, the dyn:map function returns a node set containing one exsl:string element (namespace http://exslt.org/common ) for each node in the node set passed as the first argument to the dyn:map function, in document order. The string value of each exsl:string element is the same as the result of converting the result of evaluating the expression for the relevant node to a string as with the string function.
An implementation of this extension
function
in the EXSLT dyn namespace must conform to the behaviour described in this document.
ImplementationsNo XSLT processors that we know of have built-in support for dyn:map . There are currently no third-party implementations of dyn:map . Change HistorySubmitted: 2001-11-25 Creator: Uche Ogbuji
Returns a node set containing the results of evaluating an XPath expression on each of a set of nodes.
|