Hi David,
Are there other options than base-uri? For instance, base-uri has the file name. Is there a function like that with just the path but not the file name? If not, I can certainly work with base-uri. (I couldn’t find any, but thought I’d ask)
base-uri() and document-uri() will always return the full path. You might want to check out the BaseX specific function db:info(), which gives you general database information, including the original collection path (but this is probably not what you are looking for):
http://docs.basex.org/wiki/Database_Functions#db:info
Christian
Ok, I got it figured out from this page: http://docs.basex.org/wiki/Database_%26_Collection. So, in my return concat, I need to use the “base-uri” of $song to get the actual file path. So, my query will look something like:
for $song in collection("OpenSongSearch")
where $song/song/lyrics[ . contains text "baloche"] or $song/song/title[ . contains text "baloche"] or $song/song/author[ . contains text "baloche"]
order by $song/song/title return concat(base-uri($song),string('|'), $song/song/title,string('|'),$song/song/author,string('|'),replace(replace($song/song/lyrics,'\n','^line^'),'[\w+]',''),string(' '))
Yep, that works! Sorry to bug you all with a question that’s documented!
Thanks!
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk