W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > August 2008

RE: Dynamic creation of parameters without @namespace

From: <Toman_Vojtech@emc.com>
Date: Mon, 4 Aug 2008 03:30:06 -0400
Message-ID: <6E216CCE0679B5489A61125D0EFEC7870C03A1C0@CORPUSMX10A.corp.emc.com>
To: <public-xml-processing-model-wg@w3.org>
Yes, that was what I proposed when replying to Norm's initial e-mail. But I am not sure now whether c:param should always be a NCName, or whether we should say that it must be a NCName if @namespace is provided, otherwise it can be a QName... (I don't think the latter would be too nice, though.)

Vojtech

> -----Original Message-----
> From: Innovimax SARL [mailto:innovimax@gmail.com] 
> Sent: Monday, August 04, 2008 12:34 AM
> To: Toman, Vojtech
> Cc: public-xml-processing-model-wg@w3.org
> Subject: Re: Dynamic creation of parameters without @namespace
> 
> Vojtech,
> 
> It looks like your use case is asking for defining c:param/@name as a
> NCName which could be converted to QName if c:param/@namespace is
> provided, isn'it ?
> 
> Mohamed
> 
> 
> 
> On Fri, Aug 1, 2008 at 2:10 PM,  <Toman_Vojtech@emc.com> wrote:
> >
> > Hi all,
> >
> > As discussed during yesterday's call, I have tried do craft 
> an example
> > that illustrates my concerns about removing @namespace from c:param.
> > Maybe it is convincing enough, maybe not...
> >
> > Consider the following pipeline:
> >
> > <p:pipeline xmlns:p="http://www.w3.org/ns/xproc" xmlns:foo="...">
> >  ...
> >  <foo:generate-parameters name="generate"/>
> >  <p:xslt>
> >    <p:input port="source">
> >      <p:pipe step="main" port="source"/>
> >    </p:input>
> >    <p:input port="parameters">
> >      <p:pipe step="generate" port="result"/>
> >    </p:input>
> >  </p:xslt>
> >  ...
> > </p:pipeline>
> >
> > Suppose that you want foo:generate-parameters to create a 
> c:param-set
> > document based on some dynamic criteria. Also suppose you 
> don't want to
> > use @namespace in c:param elements.
> >
> > Imagine that the namespace URIs for the parameter names are created
> > dynamically and are not known in advance. You will have to 
> come up with
> > some prefix for the namespace (so you can refer to it in 
> the parameter
> > name). If you declare the prefix on the c:param level (the easiest
> > option), you can use any prefix as long as it does not 
> clash with the
> > prefix for "http://www.w3.org/2007/03/xproc-step" namespace 
> used on the
> > param element (if the param element does not use the 
> default namespace).
> > I think this is already hard enough to do in plain XProc.
> >
> > But the main problem is, I think, the creation of namespace
> > declarations. You can't use p:add-attribute for that. You 
> could probably
> > do something like:
> >
> > <p:namespace-rename from="http://whatever.com">
> >  <p:input port="source">
> >    <p:inline>
> >      <c:param xmlns:c="http://www.w3.org/2007/03/xproc-step"
> > xmlns:x="http://whatever.com" name="x:whatever"/>
> >    </p:inline>
> >  </p:input>
> >  <p:with-option name="to" select="..."/>
> > </p:namespace-rename>
> > <p:string-replace>
> >  <!-- replace "x:whatever" in c:param/@name with 
> "x:parameter-name" -->
> > </p:string-replace>
> >
> > but I don't consider this is a very nice or safe solution. With
> > @namespace, you can do:
> >
> > <p:add-attribute attribute-name="name">
> >  <p:input port="source">
> >    <p:inline>
> >      <c:param xmlns:c="http://www.w3.org/2007/03/xproc-step"/>
> >    </p:inline>
> >  </p:input>
> >  <p:with-option name="attribute-value" select="..."/>
> > </p:add-attribute>
> > <p:add-attribute attribute-name="namespace">
> >  <p:with-option name="attribute-value" select=".../>
> > </p:add-attribute>
> >
> > This solution is, in my opinion, much cleaner/clearer 
> (although it needs
> > about the same amount of code as the previous one :-)
> >
> > You may say that you can overcome the above problems easily by using
> > XQuery or XSLT, but I really think that performing such a 
> simple task as
> > creating parameters should be possible using just the 
> "core" XProc (and
> > with as few workarounds as possible).
> >
> >
> > Regards,
> > Vojtech
> >
> >
> 
> 
> 
> -- 
> Innovimax SARL
> Consulting, Training & XML Development
> 9, impasse des Orteaux
> 75020 Paris
> Tel : +33 9 52 475787
> Fax : +33 1 4356 1746
> http://www.innovimax.fr

> RCS Paris 488.018.631
> SARL au capital de 10.000 €
> 
> 
Received on Monday, 4 August 2008 07:31:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 4 August 2008 07:31:04 GMT