W3C home > Mailing lists > Public > public-xml-processing-model-comments@w3.org > September 2007

RE: Saxonica Comments on XProc last-call draft, sections 1 and 2

From: Michael Kay <mike@saxonica.com>
Date: Thu, 27 Sep 2007 09:37:29 +0100
To: "'Norman Walsh'" <ndw@nwalsh.com>
Cc: <public-xml-processing-model-comments@w3.org>
Message-ID: <008a01c800e1$a454c680$6401a8c0@turtle>

> Yes, I was personally quite surprised when consensus went 
> that way, but it did. I don't think it's really a very 
> significant limitation because XProc steps give you other 
> ways of tackling the problem. The first that occurs to me is:
>   <p:wrap-sequence>
>     <p:input port="source">
>        <p:pipe ... gets the first of two documents ... /> 
>        <p:pipe ... gets the second of two documents ... /> 
>     </p:input>
>     <p:option name="wrapper" value="wrapper"/>
>   </p:wrap-sequence>
> Send the output of that step on to your transformation and 
> grab the two documents from inside the "wrapper".

But this (a) means rewriting the stylesheet (perhaps quite extensively - for
example it means that keys change their scope), and (b) almost certainly
cannot be implemented as efficiently, especially if one of the documents
contains lookup values that form an input to many transformations.
> I'm sure that there are some things that could be done more 
> conveniently with structured parameter and option values, but 
> I think you'll need some pretty compelling use cases to 
> persuade the WG to undertake that large a change.

I think the use cases are very compelling.

Looking at how to make the change, I have to say I find the parameter
mechanism extraordinarily complicated for what it achieves, and it's not
obvious to me as a newcomer how to bend it. I'm also trying to work out how
you would use the p:parameter/@select attribute to compute a parameter (even
a string parameter) by looking inside a document produced by a previous
step, and I confess I don't see it. There seems to be a mechanism
p:xpath-context that allows this for the expression in a p:when/@test, but
the same mechanism doesn't seem to be available for p:parameter/@select. Why
the difference? If this mechanism were added, then I think you could simply
say that the value of the parameter is the result of the select expression,
without conversion unless the step itself chooses to perform a conversion.
You could then pass a document using

<p:parameter name="lookup" select="doc('lookup.xml')"/>


<p:parameter name="lookup" select=".">


<p:parameter name="lookup" select=".">
    <p:pipe step="a" port="b"/>

(and perhaps this pattern is sufficiently common that a syntactic short-cut
is in order...)

Michael Kay
Received on Thursday, 27 September 2007 08:37:45 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:28:24 UTC