should go to the list, too...
-------- 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@le-tex.de Organization: le-tex publishing services GmbH To: C. M. Sperberg-McQueen cmsmcq@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).
basex-talk@mailman.uni-konstanz.de