EXSLT - dyn:map

Implementer Page: dyn.map.html
Function Package: dyn.map.zip

Function Syntax

node-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.

Implementations

There are currently no XSLT processors that we know of that support dyn:map natively.

There are currently no third-party implementations of dyn:map.

http://www.exslt.org/dyn/functions/map/index.html last modified 2001-11-25