Changes

Jump to navigation Jump to search
144 bytes removed ,  18:35, 1 December 2023
m
Text replacement - "</syntaxhighlight>" to "</pre>"
declare %private function local:two() { 34 };
for $f in inspect:functions() return $f()
</syntaxhighlightpre>
Compiles all functions in {{Code|code.xqm}} and invokes the function named {{Code|run}}:
<pre lang='xquery'>
where local-name-from-QName(function-name($f)) = $name
return $f()
</syntaxhighlightpre>
|- valign="top"
| '''Errors'''
<pre lang='xquery'>
inspect:static-context((), 'base-uri')
</syntaxhighlightpre>
* Returns a map with all namespaces that are statically known in the module of the specified function:
<pre lang='xquery'>
import module namespace data = 'data.xqm';
inspect:static-context(data:get#1, 'namespaces')
</syntaxhighlightpre>
|- valign="top"
| '''Errors'''
<return type="xs:integer"/>
</function>
</syntaxhighlightpre>
The function…
<pre lang='xquery'>
$number
};
</syntaxhighlightpre>
…is represented by {{Code|inspect:function(local:same#1)}} as…
<syntaxhighlight lang="xml">
<return type="xs:integer">specified number</return>
</function>
</syntaxhighlightpre>
|}
<pre lang='xquery'>
inspect:context()/function ! function-lookup(QName(@uri, @name), 0) ! .()
</syntaxhighlightpre>
Return the names of all private functions in the current context:
<pre lang='xquery'>
where $f/annotation/@name = 'private'
return $f/@name/string()
</syntaxhighlightpre>
|}
$number
};
</syntaxhighlightpre>
If {{Code|inspect:module('sample.xqm')}} is run, the following output will be generated:
</function>
</module>
</syntaxhighlightpre>
The output looks as follows if {{Code|inspect:xqdoc('sample.xqm')}} is called:
</xqdoc:functions>
</xqdoc:xqdoc>
</syntaxhighlightpre>
=Errors=
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu