Project

Profile

Help

Proper usage of the fn prefix?

Added by Anonymous almost 19 years ago

Legacy ID: #3565512 Legacy Poster: Eric P. Wittmann (paalin)

Tried searching through the forums and didn't find an answer to this, though I'm sure it's been asked before. What is the proper syntax for calling the XQuery functions that the 1.0 spec indicates are under the fn = http://www.w3.org/2005/xpath-functions namespace? We're using Saxon 8.4 I believe and it seems as though the fn functions must be referenced without the namespace. Is this correct?


Replies (2)

RE: Proper usage of the fn prefix? - Added by Anonymous almost 19 years ago

Legacy ID: #3565931 Legacy Poster: Michael Kay (mhkay)

There's never any need to use a namespace prefix with functions in the standard library since this is the "default namespace for functions" unless you set it otherwise. You can use a prefix if you want, but you have to ensure it is bound to the correct namespace, and the namespace URI changed in each successive working draft of the standards until it stabilised with the Candidate Recommendation as http://www.w3.org/2005/xpath-functions. That's the namespace supported in Saxon 8.6.1, but earlier releases will support whatever namespace was current at the time - you'll have to check the documentation for that release if you need to find out. (Or it's probably simpler to look in the source code, look for module NamespaceConstants.java and the definition of Namespace.FN.) Michael Kay

RE: Proper usage of the fn prefix? - Added by Anonymous almost 19 years ago

Legacy ID: #3569304 Legacy Poster: Eric P. Wittmann (paalin)

Perfect answer, thanks Michael.

    (1-2/2)

    Please register to reply