10 messages in org.w3.xproc-devRe: Extension function prefixes/names...
FromSent OnAttachments
Costello, Roger L.Jan 24, 2009 6:34 am 
Toma...@emc.comJan 25, 2009 11:43 pm 
David A. LeeFeb 7, 2009 10:03 am 
David A. LeeFeb 11, 2009 4:53 am 
Norman WalshApr 27, 2009 4:13 am 
Norman WalshApr 27, 2009 4:16 am 
Norman WalshApr 27, 2009 4:17 am 
David A. LeeApr 27, 2009 4:35 am 
Norman WalshApr 27, 2009 5:30 am 
David A. LeeApr 27, 2009 6:34 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Extension function prefixes/namespaceActions
From:David A. Lee (dl@calldei.com)
Date:Feb 11, 2009 4:53:51 am
List:org.w3.xproc-dev

Any comments on this ? Looking into this further, I am coming to the conclusion that extension functions should NOT share the same prefix as any schema being processed by the processor. For example is this *input* document to xproc pipeline parsable.

<p:pipeline 'xmlns:p=http://www.w3.org/ns/xproc'> <p:identity/> </p:pipeline>

By this xproc pipeline

<p:pipeline 'xmlns:p=http://www.w3.org/ns/xproc'> <p:string-replace match="p:pipeline"> <p:with-option name="replace" select="concat('&quot;',p:base-uri(//p:identity[1]),'&quot;')"

</p:string-replace> </p:pipeline>

note the use of the same prefix in replace, the function and the argument

----- Original Message ----- From: "David A. Lee" <dl@calldei.com> To: <xpro@w3.org> Sent: Saturday, February 07, 2009 1:04 PM Subject: 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.