Like you, I prefer not to type fn:
in front of all my fn:functions.
In normal XQuery main modules you don't need the fn:
prefix because that's the default function namespace and used for all unprefixed functions. You do however need fn:
in library modules because they change their default function namespace to that of the library module namespace. This means the library functions can call each other without any prefix.
But you can change it back! Here's the header code to do the switch back.
xquery version "1.0-ml";
module namespace util = "http://markmail.org/util";
declare default function namespace "http://www.w3.org/2005/xpath-functions";
Or if you're on the older 0.9-ml:
xquery version "0.9-ml"
module "http://markmail.org/util"
declare namespace util = "http://markmail.org/util"
default function namespace = "http://www.w3.org/2003/05/xpath-functions"
It puts the module in a given namespace, assigns util to that namespace, then assigns the default back to the normal fn:
one.
After this switch, function calls and definitions without a prefix will default to the fn:
prefix; that means all functions in the util
library should explicitly use a util:
prefix. (Personally, I think that's cleaner anyway.)