Thanks Rosita, that works although I seem to have hit a namespace issue
https://github.com/BaseXdb/basex/issues/397

/Andy

On Thu, Feb 23, 2012 at 12:30 AM, Rositsa Shadura <rositsa.shadura@uni-konstanz.de> wrote:
Hi Andy,

as your module parser-basex.xq is part of the package, it must be registered in the package descriptor:

<xquery>
 <namespace>parser-basex</namespace>
 <file>parser-basex.xq</file>
</xquery>

and thus the import statement in pacman.xq shall not specify its location:

import module namespace p="parser-basex";

Regards,
Rositsa



On Thu, 23 Feb 2012 00:47:06 +0100, Andy Bunce <bunce.andy@gmail.com> wrote:

I have a built an xar package with a xquery source that imports another
module.
It has three files as follows:
---expath-pkg.xml-------
<package xmlns="http://expath.org/ns/pkg" name="apb.pacman" abbrev="lib"
version="0.1" spec="1.0">
 <title>package tools</title>
 <xquery>
   <namespace>apb.pacman</namespace>
   <file>pacman.xq</file>
 </xquery>
</package>
----------lib/pacman.xq-------
xquery version "1.0" encoding "UTF-8";

module namespace q="apb.pacman";
import module namespace p="parser-basex" at "parser-basex.xq";

declare function q:info() {
 "hello from pacman"
};
declare function q:parse($xq as xs:string) {
 p:parse-XQuery($xq)
};

----------lib/parser-basex.xq-------
xquery version "1.0"
... etc
--------------------------------
In the GUI I enter:
import module namespace q="apb.pacman";
q:info()

I get the error:
Error: [XQST0059] Module not found: '/home/andy/parser-basex.xq

I  was expecting p="parser-basex" at "parser-basex.xq" to be resolved
relative to pacman.xq in the repo.
Is this a bug, or am I misreading the spec?

/Andy


--
Using Opera's revolutionary email client: http://www.opera.com/mail/