W3C home > Mailing lists > Public > xproc-dev@w3.org > February 2009

Re: Extension function prefixes/namespace

From: David A. Lee <dlee@calldei.com>
Date: Wed, 11 Feb 2009 07:54:14 -0500
Message-ID: <2F4CC88847CA4D1C9D9F16635391715E@calldei.com>
To: <xproc-dev@w3.org>

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'>

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"


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

----- Original Message ----- 
From: "David A. Lee" <dlee@calldei.com>
To: <xproc-dev@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.
> -David
> -----------------------------------------------------------
> David A. Lee
> dlee@calldei.com
> http://www.calldei.com
> http://www.xmlsh.org
Received on Wednesday, 11 February 2009 12:54:59 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:04 UTC