Project

Profile

Help

XQuery: May modules have external variables?

Added by Anonymous about 17 years ago

Legacy ID: #4415919 Legacy Poster: Michael (michael20007)

Hi all, First of all: Thanks for Saxon. It's simply the best. :D As I could not find anything about my question in the W3C specs I'm aksing here: May modules have external variables? Saxon doesn't complain about the declaration of an external variable in a module, but I don't know how to pass the argument to Saxon. Here is my simple code: (: Main module :) import module namespace m3 = "http://example.org/module3" at "module3.xquery"; $m3:foo (: Imported module :) module namespace m3 = "http://example.org/module3"; declare variable $m3:foo external; I tried to run Saxon: $ java net.sf.saxon.Query module-use-module3.xquery foo=bar and $ java net.sf.saxon.Query module-use-module3.xquery m3:foo=bar but all I get is this error: XPDY0002: No value supplied for required parameter $foo Query processing failed: Run-time errors were reported Thanks for having a look at this, Michael PS: My environment: * Saxon-B 8.9.0.4J * Sun Java version 1.6.0 * Debian Linux 4.0


Replies (2)

RE: XQuery: May modules have external variabl - Added by Anonymous about 17 years ago

Legacy ID: #4416101 Legacy Poster: Michael Kay (mhkay)

Yes, you can have such variables. To bind a value from the command line, you need to use the expanded name in Clark format, that is "{uri}local": java net.sf.saxon.Query -t test.xq {http://example.org/module3}foo=89 Michael Kay http://www.saxonica.com/

RE: XQuery: May modules have external variabl - Added by Anonymous about 17 years ago

Legacy ID: #4416274 Legacy Poster: Michael (michael20007)

Hi Michael, Perfect! :-) Thanks for your fast answer. Happy hacking, Michael

    (1-2/2)

    Please register to reply