[xquery-talk] File Systems & XQuery

Frans Englich frans.englich at telia.com
Wed Feb 7 16:42:33 PST 2007

On Wednesday 07 February 2007 16:13, Michael Kay wrote:
> Kristoffer Rose of IBM Research has demonstrated this kind of idea, but I
> can't find a reference at the moment.'

And when you bring up the topic of prior art, I vaguely recall a post on 
xml-dev about file system utilities and XPath:


Notably, Eric van der Vlist mentions how to deal with invalid XMLName 
characters in file names, if one chooses the 
"/home/fenglich/projects/"-approach. So, I conclude that only supplying that 
approach is a no-go.

Another problem is how to query a certain directory when the user has a URI, 
as opposed to a path known when writing the query. One could probably write a 
recursive function that splits the URI, but that is error prone and hackish. 
Especially considering that this is probably a rather common scenario.

Here's a new angle:

I wonder if it's justifiable to get excited about "$fs/home/fenglich". It is 
the URI syntax duplicated with an XPath path -- talk about over engineering. 
Phrased differently: if one knows the path at query-writing time, one can 
just as well write it as a URI.

The problem though, is that in that case one can't use fn:collection()(unless 
one decide to use the fragment, in some horrible way), but most likely must 
resort to a function. Not as simple, but it also opens up the door for 
inspecting file systems other than the local, such as FTP and Samba volumes.

Skipping fn:collection() in favour of extension functions(or depending on 
where such a spec is developed..) makes it more acceptable to add other 
functions, if one would need such. I was considering formatting of file 
sizes, but perhaps that is an idea that definitely should be killed as 
feature creep.


More information about the talk mailing list