Thanks, Florent! It's very useful!

Regards,
*Evgeny*

On Mon, Mar 19, 2018 at 8:34 PM, Florent Georges <li...@fgeorges.org> wrote:

> Not exactly.  You can have several library modules with the same namespace
> URI, but you have to import them all explicitly in the import statement:
>
> import module namespace ns = "http://ns";
>   at "/test/one.xqy", "/test/two.xqy";
> $ns:var1, $ns:var2
>
> ==>
> ('variable1', 'variable2')
>
> Not that it is a recommended practice though.
>
> Regards,
>
> --
> Florent Georges
> H2O Consulting
> http://h2o.consulting/
>
>
> On 19 March 2018 at 16:07, Ron Hitchens <r...@ronsoft.com> wrote:
>
>>
>>    Each module should have a unique namespace.
>>
>> ----
>> Ron Hitchens r...@overstory.co.uk, +44 7879 358212 <+44%207879%20358212>
>>
>>
>> On March 19, 2018 at 2:46:42 PM, Evgeny Degtyarev (
>> evgeny.degtya...@lambdawerk.com) wrote:
>>
>> I have three files:
>>
>> -------- module.application1.xqy --------
>> xquery version "1.0-ml";
>> module namespace ns = "http://ns";;
>> import module "http://ns"; at "module .xqy";
>> declare variable $var1 := 'variable1';
>>
>> -------- module.xqy --------
>> xquery version "1.0-ml";
>> module namespace ns = "http://ns";;
>> declare variable $var2 := 'variable2';
>>
>> -------- script.xqy --------
>> xquery version "1.0-ml";
>> import module namespace ns = "http://ns"; at "module.application1.xqy";
>> (: echo :)
>> $ns:var1, $ns:var2
>>
>> ------------------------------------------------------------
>> ----------------------
>>
>> When I run the  script.xqy, I'm getting the following error:
>> *XDMP-UNDVAR: (err:XPST0008) Undefined variable $ns:var2*
>>
>> Why it's not possible to access  $ns:var2 from the script this way?
>> _______________________________________________
>> General mailing list
>> General@developer.marklogic.com
>> Manage your subscription at:
>> http://developer.marklogic.com/mailman/listinfo/general
>>
>>
>> _______________________________________________
>> General mailing list
>> General@developer.marklogic.com
>> Manage your subscription at:
>> http://developer.marklogic.com/mailman/listinfo/general
>>
>>
>
> _______________________________________________
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
_______________________________________________
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to