Describe the bug
For a small number of eXist extension functions, util:registered-functions returns results with a null namespace prefix.
This causes incorrect the namespace prefix for affected functions to be omitted in eXist's function documentation, and prevents IDEs such as oXygen from accessing the affected functions when users request function autocompletion/documentation based on a function's prefix. (See screenshots below.)
Affected functions:
http://exist-db.org/xquery/xmldbhttp://exist-db.org/xquery/inspectionhttp://exist-db.org/xquery/systemhttp://exist-db.org/xquery/sqlhttp://exist-db.org/xquery/utilhttp://exist-db.org/xquery/compressionExpected behavior
Every function returned by util:registered-functions should have the namespace prefix of its parent module鈥攁nd should never return a null namespace prefix.
To Reproduce
The query below lists which functions are affected.
xquery version "3.1";
for $namespace-uri in util:registered-modules()
let $functions := try { util:registered-functions($namespace-uri) } catch * { <error>{$err:code} raised when getting registered functions for module {$namespace-uri}</error> }
return
if ($functions instance of element(error)) then
()
else
let $prefix-analysis :=
for $function in $functions
group by $prefix := fn:prefix-from-QName($function)
return
map {
"prefix": $prefix,
"functions":
array { $function ! fn:local-name-from-QName(.) }
}
where count($prefix-analysis) gt 1
order by $namespace-uri
return
map {
"module": $namespace-uri,
"prefix-analysis": array { $prefix-analysis }
}
Note, too, that running inspect:inspect-functions on the same modules returns results with a similar discrepancy - base64-encode has a prefix, whereas binary-doc lacks one:
<function name="util:base64-encode" module="http://exist-db.org/xquery/util"/>
<function name="binary-doc" module="http://exist-db.org/xquery/util"/>
Screenshots
oXygen's function documentation omits util:binary-doc:
eXist's function documentation omits the prefix for util:binary-doc:
Context (please always complete the following information):
Additional context
conf.xml? noIt looks like that all the 'wrong' functions use the same 'new' function definitions:

I found the issue... fix on its way
this sequence shall be empty:
for $namespace-uri in util:registered-modules()
let $functions := try { util:registered-functions($namespace-uri) } catch * { <error>{$err:code} raised when getting registered functions for module {$namespace-uri}</error> }
for $fie in $functions
return
if( contains($fie,":") or contains($namespace-uri, "w3.org") )
then () else $fie || " in " || $namespace-uri
@dizzzz Your test query is exactly right. Thank you!