XQuery Function Documentation

Search and Browse

ex:addresses

ex:addresses($node as node(), $model as map(*)) as map(*)

Parameters:
$node $node
$model $model
Returns:
map(*)

ex:hello

ex:hello($node as node()*, $model as map(*)) as element()

Simple templating function. A templating function needs to take two parameters at least. It may return any sequence, which will be inserted into the output instead of $node.

Parameters:
$node* the HTML node which contained the class attribute which triggered this call.
$model an arbitrary sequence of items. Use this to pass required information between tempate functions.
Returns:
element()

ex:hello-world

ex:hello-world($node as node(), $model as map(*), $language as xs:string, $user as xs:string) as xs:string

Parameters:
$node $node
$model $model
$language $language
$user $user
Returns:
xs:string

ex:multiply

ex:multiply($node as node()*, $model as map(*), $n1 as xs:int, $n2 as xs:int) as item()*

A templating function taking two additional parameters. The templating framework inspects the function signature and tries to fill in additional parameters automatically. The value to use is determined as follows: <ol> <li>if there's a (non-empty) request parameter with the same name as the variable, use it</li> <li>else if there's a (non-empty) session attribute with the same name as the variable, use it</li> <li>test if there's an annotation %templates:default(name, value) whose first parameter matches the name of the parameter variable. Use the second parameter as value if it does.</li> </ol>

Parameters:
$node* $node*
$model $model
$n1 $n1
$n2 $n2
Returns:
item()*