From: Dave F. <dav...@gm...> - 2011-04-16 04:33:37
|
I'd like to define a function (or two) where they can be called one of the following ways: *dave-module:my-function ($my-string as xs:string) dave-module:my-function ($my-integer as xs:integer)* The problem is that eXist (or perhaps it's the XQuery language in general) doesn't like this, as it seems unless I define functions based on the *number* of parameters as opposed to the *type*, I get an error. No matter how I try, the interpreter seems to want one over the other. My question: Is there a way to not have to do any obvious workarounds to get this to work? Right now all I can do is to define the functions as follows, which does work: *dave-module:my-function-s ($my-string as xs:string) dave-module:my-function ($my-integer as xs:integer)* (note the "-s" at the end of the function name to denote the fact that it is expecting a string) I'm using eXist 1.5 trunk (I forget the revision number off the top of my head). My apologies if this is a neophyte question, but after a day of rummaging through the documentation, I'm kind of at a loss. -- David Finton |