[xquery-talk] XQuery Style Conventions

Martin Probst martin at x-hive.com
Mon Oct 24 11:09:53 PDT 2005


Hi,

> My inclination is that modules should either be fetched by name or by
> location. I don't see very much sense in using the location URI and then
> making it anything other than a dereferencable relative URI that returns the
> query text. If you want some sort of catalog to provide indirection, then it
> makes sense to drive this from the module namespace URI rather than from the
> location hints.

I think that's what Darin's approach is about? In the example
"/fabrication/utilities.xqy" is supposed to lead to the query, isn't it?

I tend to think of namespace URIs as opaque strings, whose only property
is that they are different from or equal to others.

I would try to give modules namespaces that are certainly distinct from
others, i.e. that provide a full path, and then use the location part to
actually find the module. If you use the module namespace to find the
module you might get problems, e.g. if you have your module somewhere on
your hard disk, then URI would be "file:///my/xquery/module.xq". That's
certainly not a very good distinct namespace URI for a module.

Mixing this "distinct names" thing with URIs that actually lead to
something is for sure not nice, but the usability problem with that is
somewhere in the XML namespaces spec. Users will probably just have to
grok that.

> > Module Namespace URIs
> > =====================
> > [...]
> > http://xquery.elsevier.com/fabrication/utilities
> > 
> > Module Location URIs
> > ====================
> > [...]
> > /fabrication/utilities.xqy

I like that!

Martin



More information about the talk mailing list