The option to specify path in collection is good one.
add as item02.xml to "/dir/subdir" <root2/>
creates two documents there (both path versions works the same, with or without slash)
base-uri reports names starting "file:/D:/opt/BaseX/dir/subdir"
(what might confuse a bit, but not much)
xquery for $doc in collection("Pokus/dir/subdir") return base-uri($doc)
selects both items properly (of course showing the 'D:/opt/BaseX/' inside of the base-uri result string).
xquery for $doc in collection("Pokus/") return base-uri($doc)
selects all items in the collection, not only from the root
xquery for $doc in collection("") return base-uri($doc)
selects all items in the currently open collection, if one used
open <collection>, otherwise it complains about no default collection.
I did not find any way how to query relative path in current collection without naming it. No real need for this now.
With best regards
Jan
On Tue, Oct 26, 2010 at 11:37 AM, Michael Seiferle
<michael.seiferle@uni-konstanz.de> wrote:
Hi Jan,
I am sorry but at the moment there is - to my knowledge - way of specifying a custom prefix to the base-uri().
You can as well, starting from 6.3, provide a path to documents inside a collection via:
for $doc in collection('test/dir')
return base-uri($doc)
Anyway, regarding your issue:
for $doc in collection('test/dir')
return replace(base-uri($doc),'file:/path/foo/bar/','')
might do the trick.
Kind regards
Michael
Am 26.10.2010 um 11:16 schrieb Jan Vlčinský:
I tried many ways how to specify target - without and with slash and backslash - no change.
Is there any way to manage that?
Jan Vlčinský
PS: Be sure this is not a problem if it is not possible. it would be only a bit nicer.
--
Jan Vlčinský
Slunečnicová 338/3, 734 01 Karviná Ráj, Czech Republic
tel: +420-597 602 024;
mob: +420-608 979 040
skype: janvlcinsky;
GoogleTalk: jan.vlcinsky@gmail.com