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

Re: Inputs and outputs

From: Alex Milowski <alex@milowski.org>
Date: Thu, 20 Jul 2006 12:32:19 -0700
Message-ID: <44BFDA43.2060301@milowski.org>
To: public-xml-processing-model-wg@w3.org

Norman Walsh wrote:
> With that in mind, we could do it like this:
> 
>   <p:pipeline>
>     <!-- accept a document, a schema, and a stylesheet. -->
>     <!-- validate, transform, and return the result -->
>     <p:declare-input-port port="document" name="xmlfile"/>
>     <p:declare-input-port port="schema" name="xsdfile"/>
>     <p:declare-input-port port="stylesheet" name="xslfile"/>
>     <p:declare-output-port port="result" name="output"/>
> 
>     <p:step kind="validate">
>       <p:input port="document" from="xmlfile"/>
>       <p:input port="schema" from="xsdfile"/>
>       <p:output port="result" name="validxml"/>
>     </p:step>
> 
>     <p:step kind="xslt">
>       <p:input port="document" from="validxml"/>
>       <p:input port="stylesheet" from="xslfile"/>
>       <p:output port="result" to="output"/>
>     </p:step>
>   <p:pipeline>

OK.  I'm quite happy with this.

> 
> Or we could say:
> 
>   <p:pipeline>
>     <!-- accept a document, a schema, and a stylesheet. -->
>     <!-- validate, transform, and return the result -->
>     <p:declare-input-port port="document" name="xmlfile"/>
>     <p:declare-input-port port="schema" name="xsdfile"/>
>     <p:declare-input-port port="stylesheet" name="xslfile"/>
>     <p:declare-output-port port="result" name="output"/>
> 
>     <p:step kind="validate">
>       <p:input port="document" from="xmlfile"/>
>       <p:input port="schema" from="xsdfile"/>
>       <p:output port="result" to="styler"/>
>     </p:step>

I'm confused by the 'to' value of 'styler' above.  That isn't defined
in this pipeline example.

> 
>     <p:step kind="xslt">
>       <p:input port="document"/>
>       <p:input port="stylesheet" from="xslfile"/>
>       <p:output port="result" to="output"/>
>     </p:step>
>   <p:pipeline>


> 
> Or we could do the naming "Richard's way":
> 
>   <p:pipeline name="pipe">
>     <!-- accept a document, a schema, and a stylesheet. -->
>     <!-- validate, transform, and return the result -->
>     <p:declare-input-port port="document"/>
>     <p:declare-input-port port="schema"/>
>     <p:declare-input-port port="stylesheet"/>
>     <p:declare-output-port port="result"/>
> 
>     <p:step kind="validate" name="validate">
>       <p:input port="document" from="pipe.document"/>
>       <p:input port="schema" from="pipe.schema"/>
>       <p:output port="result"/>
>     </p:step>
> 
>     <p:step kind="xslt" name="transform">
>       <p:input port="document" from="validate.result"/>
>       <p:input port="stylesheet" from="pipe.stylesheet"/>
>       <p:output port="result" to="pipe.result"/>
>     </p:step>
>   <p:pipeline>

If we were to do this, we'd need to use something other than
the "." for syntax.  Personally, I'm not really moved by
this idea.

>     <p:choose>
>       <p:declare-input-port port="testdocument" from="validxml"/>
>       <p:declare-output-port port="result" name="xformed"/>

That would be a nice shortcut.

> 
> Anyway, the important bits are:
> 
>  1. Inside the p:choose, the only input ports available are the ones
>     locally declared. This makes p:choose a wholly self-contained
>     element which I really like.
> 
>  2. If there's any p:when that does not have a binding to all of the
>     declared output-ports, that's a static error.

Or that output is just not produced.  We do have a choice there.  It
would be a static error if the output of the pipeline could not
be produced.  Having a choice where the output is option might be
nice.

The problem there would be that in some situations, a choice with
'when' clauses with no output would be allowed, but in others--where
the output is traceable to the output of the pipeline, it would not.
That might drive users insane.

> Also, while I'm not a huge fan of the name "port", by using it I have
> been able to reserve the attribute "name" exclusively for names that
> authors invent in order to point at them which I think will make
> Murray and Alex happy.

Yes.  This makes me happy. :)

--Alex Milowski
Received on Thursday, 20 July 2006 19:32:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:21:48 GMT