document-uri() and directory structure within collections
Tuesday, 22 June 2010 · 2 messages
CS
C. M. Sperberg-McQueen22 Jun 2010 00:37 #
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).
--
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com
* http://cmsmcq.com/mib
* http://balisage.net
****************************************************************
CG
Christian Grün22 Jun 2010 02:05 #
Quoted text · C. M. Sperberg-McQueen · 7 lines
> 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
Thanks to Gerrit – yes, this problem has been solved with version 6.1.4.
Quoted text · C. M. Sperberg-McQueen · 3 lines
> 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.)
No reason to be sorry. We have to accept that as long as there are acceptable alternatives around ;)
Quoted text · C. M. Sperberg-McQueen · 3 lines
> 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).
We hope you'll eventually find some way to get BaseX 6.0 running. A Lot has been changed since 5.x.
All the best,
Christian
Written for BaseX 6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery