I’ve run into the same thing in my Validation Dashboard—I need to go from files within a directory to their full path because I’m translating file system paths in to repo-local paths and whatnot.

 

As Hans-Juergen shows, it’s not hard to combine the path you just passed to file:path() and the name but it’s annoying to have to do it.

 

Cheers,

 

E.

 

_____________________________________________

Eliot Kimber

Sr Staff Content Engineer

O: 512 554 9368

M: 512 554 9368

servicenow.com

LinkedIn | Twitter | YouTube | Facebook

 

From: BaseX-Talk <basex-talk-bounces@mailman.uni-konstanz.de> on behalf of Liam R. E. Quin <liam@fromoldbooks.org>
Date: Friday, February 11, 2022 at 1:07 PM
To: Hans-Juergen Rennau <hrennau@yahoo.de>, BaseX <basex-talk@mailman.uni-konstanz.de>
Subject: Re: [basex-talk] Feature request - file listing

[External Email]


On Fri, 2022-02-11 at 18:40 +0000, Hans-Juergen Rennau wrote:
>
> (a) It is the full paths what we need in order to parse the files
> (doc(), json:doc(), csv:doc(), html:doc()).

Why?

A relative path should work fine; if necessary you can use resolve-
uri() to turn a relative path into a full URI.

> (b) The combination of file listing and parsing in a single
> expression is of matchless elegance and expressiveness
>
> Currently, if I don't overlook something, I have to do this:
> file:list($dir, false(), $fname) ! concat($dir, '/', .) ! doc(.) =>
> count()

Probably, you should use resolve-uri($dir, base-uri(.)) although i
suppose you also need to watch for filenames containing colons...

--
Liam Quin, https://urldefense.com/v3/__https://www.delightfulcomputing.com/__;!!N4vogdjhuJM!UiKCPedrJtAEOktUyXkuK6E_cB-poSonq-v2i0BLuTk97ARgvkqXh6kzGQDRC4GqOSKbIw$
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations:  https://urldefense.com/v3/__http://www.fromoldbooks.org__;!!N4vogdjhuJM!UiKCPedrJtAEOktUyXkuK6E_cB-poSonq-v2i0BLuTk97ARgvkqXh6kzGQDRC4E1wn9xTg$