Documentation on Module Imports Missing a Detail

Sunday, 12 April 2015 · 3 messages
CG
Christian Grünin reply to Eliot Kimber, 12 Apr 2015, 20:0212 Apr 2015 18:56 #
Hi Eliot, I agree, the documentation could surely be more precise here. Would you possibly be interested in editing it? We are always interested in external contributions (the only reason for enforcing a registration is that we had to stop spamming activities in the past).
Quoted text · Eliot Kimber · 2 lines
> In the case of URNs, the token separator is ":", so you could treat each > token as a directory name.
Sounds reasonable; I've added an issue for that (https://github.com/BaseXdb/basex/issues/1124). Cheers, Christian
EK
Eliot Kimber12 Apr 2015 20:02 #
I was trying to have a RESTXQ module import a library module stored in the configured REPO directory. I copied my module into that directory and verified that it was listed: Name Version Type Path ----------------------------------------------------- basex-utils - Internal basex-utils.xqm dita-utils - Internal dita-utils.xqm linkmgmt-utils - Internal linkmgmt-utils.xqm relpath-utils - Internal relpath-utils.xqm 4 package(s). Where I want to import the basex-utils module. The docs say: <lq> Repository modules are stored in a directory named BaseXRepo or repo, which resides in your home directory <http://docs.basex.org/wiki/Configuration#Home_Directory>. XQuery modules can be manually copied to the repository directory or installed and deleted via commands <http://docs.basex.org/wiki/Repository#Commands>. If a modules is placed in the repository, there is no need to specify a location. </lq> However, this import failed to find the module:
import module namespace
bxutil="http://dita-for-small-teams.org/xquery/modules/basex-utils";
But, after I did an explicit REPO INSTALL on the module, BaseX put it in a directory that mirrors the namespace URL structure. At that point the import succeeded. Thus, it appears that the module needs to be installed or otherwise stored in a directory that mirrors the namespace declaration--it is not sufficient to simply copy the module into the repo directory. I think this assumption that the namespace URI will be a URL is not valid. If I create a module that uses a URN for the namespace URI, I get this failure on REPO INSTALL: [bxerr:BXRE0002] URI is invalid or has no path component: 'urn:names:xquerymodule:testurn'. In the case of URNs, the token separator is ":", so you could treat each token as a directory name. Cheers, Eliot
EK
Eliot Kimberin reply to Christian Grün, 12 Apr 2015, 18:5612 Apr 2015 21:20 #
Yes, I can update the documentation. Cheers, E. ————— Eliot Kimber, Owner Contrext, LLC http://contrext.com
Quoted text · Christian Grün · 17 lines
On 4/12/15, 11:56 AM, "Christian Grün" <christian.gruen at gmail.com> wrote: >Hi Eliot, > >I agree, the documentation could surely be more precise here. Would >you possibly be interested in editing it? We are always interested in >external contributions (the only reason for enforcing a registration >is that we had to stop spamming activities in the past). > >> In the case of URNs, the token separator is ":", so you could treat each >> token as a directory name. > >Sounds reasonable; I've added an issue for that >(https://github.com/BaseXdb/basex/issues/1124). > >Cheers, >Christian >

⚡Generated with XQuery