Re: Pipeline naming example

Norm,

1) Looking at the choose input:

<p:choose name="validxi">
    <p:declare-input port="input" ref="#pipe/pre-xi-schema"/>

The name of the port ("input") seems to be a convention. Adding
port="input" does not add any additional useful information, as it
would always be "input". What about removing it, and moving the 'ref'
on the <p:choose> element? We get rid of a "convention", and make the
syntax lighter. That would leave us with:

<p:choose name="validxi" ref="#pipe/pre-xi-schema">

2) Looking at how we connect the choose output to steps outputs:

<p:choose name="validxi">
    <p:declare-input port="input" ref="#pipe/pre-xi-schema"/>
    <p:declare-output port="result"/>

    <p:when test="/*">
        <p:step kind="validate">
            <p:input port="document" ref="#pipe/document"/>
            <p:input port="schema" ref="#pipe/pre-xi-schema"/>
            <p:output port="result" ref="#validxi/result"/>
        </p:step>
    </p:when>

We add a special case here, just for the choose: the ability for an
output to reference something. I prefer to avoid this special case by
(a) naming output instead of steps and (b) using a 'ref' on the
<p:declare-output/>. This way the data provider declares a name, and
the data consumer makes a reference to that name. With this we would
have:

<p:choose ref="pre-xi-schema">
    <p:declare-output ref="result" name="validxi"/>

    <p:when test="/*">
        <p:step kind="validate">
            <p:input port="document" ref="document"/>
            <p:input port="schema" ref="pre-xi-schema"/>
            <p:output port="result" name="result"/>
        </p:step>
    </p:when>

Naming outputs and naming steps is largely similar. I prefer naming
steps because it allows what is suggested above, and because it avoids
yet another special syntax (#.../...).

That's all for now,

Alex
-- 
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/

Received on Thursday, 3 August 2006 03:10:18 UTC