I guess you’re right.

We haven’t revised EXPath packaging for a long time now. Actually, I’m
not sure how many people use it at all ;)  Anyone out there?


On Mon, Jan 24, 2022 at 4:08 PM Eliot Kimber
<eliot.kim...@servicenow.com> wrote:
>
> I did confirm that if the package @name URI matches the URI of a module, then 
> the module is resolved, i.e.:
>
> <package xmlns="http://expath.org/ns/pkg";
>   name="http://servicenow.com/xquery/module/now-dita-utils";
>   abbrev="now-xquery"
>   version="0.1" spec="1.0">
>   <title>XQuery modules for ServiceNow Product Content processing and 
> support</title>  <xquery>
>     
> <namespace>http://servicenow.com/xquery/module/database-from-git</namespace>
>     <file>database-from-git.xqm</file>
>   </xquery>
>
>   …
>
> </package>
>
> That implies that each module needs to be in a separate XAR file in order to 
> also be in a separate namespace.
>
> I don’t think that is consistent with the EXPath packaging spec.
>
> In the description of the XQuery entry it says:
>
> An XQuery library module is referenced by its namespace URI. Thus the xquery 
> element associates a namespace URI to an XQuery file. An importing module 
> just need to use an import statement of the form import module namespace xx = 
> "<namespace-uri>";.
> An XQuery main module is associated a public URI. Usually an XQuery package 
> will provide functions through library modules, but in some cases one can 
> want to provide main modules as well.
> This implies to me that the value of the <namespace> element in the <xquery> 
> is what should be used to resolve the package reference, not the package’s 
> @name value, which simply serves to identify the package.
>
> Is my analysis correct or have I misunderstood the package mechanism?
>
> Cheers,
> E.

Reply via email to