Emmanuel,
Sorry for letting you wait! I guess you would like to have a function like function-lookup("*:abc") ?
I looked at your example, and I must confirm there is no way to look up functions if the namespace is unknown. I see two ways out:
1. Use inspect:functions() to browse through all statically available functions [1] and choose the ones you need.
2. If you know the namespace in advance, it's possible best to do what you already did: Try to find the custom namespace, and resort to the default if no function is returned. Here is an alternative way to put it:
let $suffix := '.models.' || map:get($queryParams, 'model') || ':' || map:get($queryParams, 'dataType') let $function := ( for $prefix in (map:get($queryParams, 'project'), 'synopsx') return fn:function-lookup($prefix || $suffix, 1) )[1] return xs:QName($function)
Hope this helps, Christian
[1] http://docs.basex.org/wiki/Inspection_Module#inspect:functions
On Tue, Feb 10, 2015 at 2:41 PM, Emmanuel Chateau emchateau@laposte.net wrote:
Hi Christian, Here is the example of what we would achieve :
https://gist.github.com/emchateau/5d8af7f53d6f346512c1
Thanks,
Emmanuel and Philippe
Le 10 févr. 2015 à 14:26, Christian Grün christian.gruen@gmail.com a écrit :
to