document-uri() and directory structure within collections
Monday, 21 June 2010 · 1 message
IL
Imsieke, Gerrit, le-tex21 Jun 2010 22:49 #
should go to the list, too...
Quoted text · 64 lines
-------- Original Message -------- Subject: Re: [basex-talk] document-uri() and directory structure within collections Date: Mon, 21 Jun 2010 22:48:22 +0200 From: Imsieke, Gerrit, le-tex <gerrit.imsieke at le-tex.de> Organization: le-tex publishing services GmbH To: C. M. Sperberg-McQueen <cmsmcq at blackmesatech.com> I asked the same question recently. In reaction they implemented base-uri() in 6.1.4, which works as required. Reading the spec, I find it hard to recognize any semantic differences between base-uri() and document-uri(). Gerrit On 21.06.2010 22:37, C. M. Sperberg-McQueen wrote: > I've used BaseX to create a database of the XML Schema Test Suite, > by specifying (in the GUI) the test suite's root directory and > a filter of *.xml. (Well, to be completely explicit it's the > root directory of a mirror in which each file is a symbolic > link to the real test suite directories; this allows me to > exclude ill-formed input and rename all XSD files as .xsd.xml.) > > But I find that when I retrieve an element $e and ask what > document it was in, using document-uri($e), I do not get > the expected result: I get the file name of the document, > but I do not get the path to the document, only the path > to the database root. > > For example: the BaseX database I'm working with was created > by indexing directory /home/xmlschema/mirror-11. And for > a query result element $a found in document > /home/xmlschema/mirror-11/msData/additional/test73850.xml > the expression document-uri($a/root()) returns > > /home/xmlschema/mirror-11/test73850.xsd.xml > > instead of the expected > > /home/xmlschema/mirror-11/msData/additional/test73850.xml > > (Side note: I do realize that the 'root()' in '$a/root()' is > irrelevant; it's there to work around a bug in another XQuery > processor, which shall remain nameless, which otherwise > returns the empty sequence. Yes, it's true: I am seeing > other XQuery engines as well as BaseX. I blush to admit it, > because it makes me seem kind of promiscuous, but it's > true.) > > Is this a bug? Did I do something wrong / set some parameter > wrong when creating the database?) Is there a workaround? > > If it matters, I'm running BaseX 5.7 (cannot move to BaseX 6 > at the moment because no Java 6 is available for my current > hardware and software). > -- Gerrit Imsieke Geschäftsführer / Managing Director le-tex publishing services GmbH Weissenfelser Str. 84, 04229 Leipzig, Germany Phone +49 341 355356 110, Fax +49 341 355356 510 gerrit.imsieke at le-tex.de, http://www.le-tex.de Registergericht / Commercial Register: Amtsgericht Leipzig Registernummer / Registration Number: HRB 24930 Geschäftsführer: Gerrit Imsieke, Svea Jelonek, Thomas Schmidt, Dr. Reinhard Vöckler
Written for BaseX 6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery