Changes

Jump to navigation Jump to search
726 bytes added ,  15:01, 19 May 2014
no edit summary
==inspect:functions==
 
{{Mark|Updated with Version 7.8.3:}} a query URI can now be specified with [[#inspect:functions|inspect:functions]].
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|inspect:functions||function(*)*}}<br/>{{Func|inspect:functions|$uri as xs:string|function(*)*}}
|-
| '''Summary'''
|Returns function items for all user-defined functions (both public and private) that are known in the current query context. If a {{Code|$uri}} is specified, the addressed file will be compiled, its functions will be added to the query context and returned to the user.
|-
|'''Examples'''
|The following query Invokes the declared function and returns its value (<code>42</code>):<br/>
<pre class="brush:xquery">
declare %private function local:solution() { 42 };
for $f in inspect:functions() return $f()
</pre>
Compiles all functions in {{Code|code.xqm}} and invokes the function named {{Code|run}}:
<pre class="brush:xquery">
let $uri := 'code.xqm'
let $name := "run"
for $f in inspect:functions($uri)
where local-name-from-QName(function-name($f)) = $name
return $f()
</pre>
|}
=Changelog=
 
;Version 7.8.3
 
* Updated: a query URI can now be specified with [[#inspect:functions|inspect:functions]].
This module was introduced with Version 7.7.
[[Category:XQuery]]
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu