Determining whether a function exists
Howdy --
I'm trying to determine whether sql:execute-prepared exists, to have a module that functions in both BaseX 7.3 and 7.5.
However --
exists(function-lookup(xs:QName("sql:execute-prepared"), 2))
returns false even in BaseX 7.5, even though
function-name(function-lookup(xs:QName("sql:execute-prepared"), 2))
properly returns "sql:execute-prepared".
Am I going to have to use a try block to detect this case?
Hi Charles,
Quoted text · Charles Duffy · 1 line
> exists(function-lookup(xs:QName("sql:execute-prepared"), 2))
interesting one; this always gives me true, no matter how desperately I try; do you have some more hints how to make this happen? Are you sure you tried it with 7.5?
Christian
You're right -- it does always give true.
However, exists(function-lookup(xs:QName("sql:i-do-not-exist"), 2))
also returns true 100% of the time.
On Mon, Jan 14, 2013 at 6:03 PM, Christian Grün <christian.gruen at gmail.com>wrote:
Quoted text · Christian Grün · 10 lines
> Hi Charles, > > > exists(function-lookup(xs:QName("sql:execute-prepared"), 2)) > > interesting one; this always gives me true, no matter how desperately > I try; do you have some more hints how to make this happen? Are you > sure you tried it with 7.5? > > Christian >
Quoted text · Charles Duffy · 2 lines
> However, exists(function-lookup(xs:QName("sql:i-do-not-exist"), 2)) > also returns true 100% of the time.
True 100%; fixed in the latest snapshot [1]. Christian
Written for BaseX 7.5. BaseX may have changed since: please check the current documentation.