Extension function prefixes/namespace

I'm implementing the extension functions for the XProc processor.
I cant find anywhere in the specs which defines explictly what the "prefix" 
has to be.
The examples use "p:" and by implication

---
3.1
http://www.w3.org/ns/xproc

The namespace of the XProc XML vocabulary described by this specification; 
by convention, the namespace prefix "p:" is used for this namespace.
----

So by power of deduction, seeing "p:" used for extension functions implies 
maybe these functions are supposed to be really
"Whatever prefix is in the namespace scope which is bound to the URL 
http://www.w3.org/ns/xproc"

Here's my confusion.   From an implementation point of view (and maybe a 
spec point of view?)
XProc extension functions dont really belong to "namespaces" they are 
associated with "prefixes" (???).
XQuery functions, on the other hand do follow a rigerous namespace model, 
but XProc functions dont seem to.

Using the Saxon API's the way to associate prefixes with extension functions 
is via namespaces, but not of the URI sort.  Rather you define a namespace 
mapping of "prefix" -> "java:java class", e.g.
   xmlns:p="java:my.package.Class"
(or programatically   declareNamespace("prefix" , "java:my.package.Class") ;

So the concept of 'namespace' is overloaded for both element/attribute 
namespaces, and function prefixes.

Further complications are that I dont  belive I can simultaneously bound the 
same prefix to both
an external function and the xproc schema.   Now of course the xproc 
document is processed in a different phase of the process then the xproc 
expressions so there is no intrinsic conflict. (p: could be used for the 
xproc document and then re-declared durning the evalutation of the xpath 
expression ... )
But suppose someone wanted to use xproc to parse an xproc document ... then 
an xproc statement may need to handle an xproc namespace'd element as well 
as an xproc "namespaced" extension function, both using the same prefix ... 
That is, if I'm supposed to use whatever prefix is bound to 
http://www.w3.org/ns/xproc
for the extension functions and simultaneously bind it to 
http://www.w3.org/ns/xproc for elements.
I dont think I can do that simultaneously.

Is this making any sense ?  could come up with some examples if it isnt.

-David
-----------------------------------------------------------
David A. Lee
dlee@calldei.com
http://www.calldei.com
http://www.xmlsh.org

Received on Saturday, 7 February 2009 18:04:54 UTC