ex:addresses($node as node(), $model as map(*)) as map(*)
$node | $node |
$model | $model |
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.
$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. |
ex:hello-world($node as node(), $model as map(*), $language as xs:string, $user as xs:string) as xs:string
$node | $node |
$model | $model |
$language | $language |
$user | $user |
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>
$node* | $node* |
$model | $model |
$n1 | $n1 |
$n2 | $n2 |
ex:print-city($node as node(), $model as map(*)) as item()*
$node | $node |
$model | $model |
ex:print-name($node as node(), $model as map(*)) as item()*
$node | $node |
$model | $model |
ex:print-street($node as node(), $model as map(*)) as item()*
$node | $node |
$model | $model |