The eutil:eval(xquery-string,context-item) function is similar to eutil:eval(xquery-string) except that the evaluation is performed with the context item set to the value of the second argument. The static type of the context item is defined to be "item()". The context item is a value that the XQuery evaluator makes available to the query that can be set by the implementation.
Function Signature | eutil:eval($xquery-string as xs:string, $context-item as item()) as item()* |
Function Summary | The eutil:eval(xquery-string,context-item) function is similar to eutil:eval(xquery-string) but in addition sets the context item to the provided item. |
Parameters | $xquery-query as xs:string, $context-item as item() |
Example | eutil:eval("let $item as node() := . treat as node() return $item/text()", <something>some text</something>) "some text" |
Errors Thrown |
For more details about the errors thrown by external functions, see the topic "Error code listing." |
Note | The context-item type is item(), so you need a treat expression or something similar to use it as a value with a more specific type. |