W3C home > Mailing lists > Public > public-qt-comments@w3.org > August 2004

Re: three questions regarding library modules

From: Jonathan Robie <jonathan.robie@datadirect.com>
Date: Tue, 17 Aug 2004 14:14:41 -0400
Message-ID: <41224B11.2070107@datadirect.com>
To: "Mark D. Anderson" <mda@discerning.com>
CC: public-qt-comments@w3.org

Mark D. Anderson wrote:

>>>declare variable $mainvar = 'fred';
>>>import module foo = "http://whatever.org/modules/foo" at "foo.xq";
>>>Should foo.xq allow:
>>>module namespace foo = "http://whatever.org/modules/foo";
>>>declare function foo:getmain() {$mainvar};
>>foo.xq has no way to import the main module. If you aren't a library 
>>module, you can't be imported. So there's no way for foo.xq to get 
>>access to $mainvar.
> And since module import can't be recursive, it can't get it via
> a function defined in the main module either.
> I guess the ways a library module can get data is:
> 1. passed in as a function call argument.

> 2. from calling a function or accessing a variable
> that is available to both the main module and the library
> module (main imports C and library imports C).


> xquery implementations I've played with so far seem to 
> not support setting an external variable that has a
> prefix. When that is the case, it would seem that
> a library module only has mechanism (1) to get the
> information?
> Otherwise I could make up a library module called
> vars.xq that puts all the external variables in some
> "vars" namespace, and then the main module and all
> library modules could use the same variables, all
> prefixed with "vars:".....

Yes, this works too. And this was used in examples that motivated modules.

Received on Tuesday, 17 August 2004 18:15:17 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:20 UTC