--- Jos Vos <[EMAIL PROTECTED]> wrote:

> What do you exactly propose here (examples please)?
> I'm not sure if I like it :-).

One suggestion is to consider invalid a pipeline where one or more id is
declared but never used. For instance, the pipeline below would be invalid
as the output "unused-id" is never referenced.

    <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline";
        xmlns:oxf="http://www.orbeon.com/oxf/processors";>
    
        <p:processor name="oxf:identity">
            <p:input name="data"><dummy/></p:input>
            <p:output name="data" id="unused-id"/>
        </p:processor>
        
    </p:config>

There is a drawback and a benefit to considering used ids as errors that
are specific to the fact that XPL is a lazily evaluated pipeline language.
Let's consider this pipeline:

    <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline";
        xmlns:oxf="http://www.orbeon.com/oxf/processors";>
    
        <p:param name="pipeline-output" type="output"/>
        
        <p:processor name="oxf:identity">
            <p:input name="data"><dummy/></p:input>
            <p:output name="data" id="first-processor-output"/>
        </p:processor>
        
        <p:processor name="oxf:identity">
            <p:input name="data" href="#first-processor-output"/>
            <p:output name="data" id="second-processor-output"/>
        </p:processor>
        
        <p:processor name="oxf:identity">
            <p:input name="data" href="#second-processor-output"/>
            <p:output name="data" ref="pipeline-output"/>
        </p:processor>
        
    </p:config>

Now let's assume that at some point, say to test something you change the
last (3rd) processor in:

    <p:processor name="oxf:identity">
        <p:input name="data"><dummy/></p:input>
        <p:output name="data" ref="pipeline-output"/>
    </p:processor>

Now the id "second-processor-output" is not used, so you would have to
comment the 2nd processor to make the pipeline valid. But then
"first-processor-output" is not used; so you would have to comment the 1st
processor as well.

The drawback: in this kind of situation you might have a lot of commenting
to do.

The benefit: if unused ids are not considered as an error, the two first
processors can stay and a user can get confused as to why they are not
called. (Assume a case where those processors have a side effect.) With
the example here, it is very obvious, but in more complex pipelines one
can quite easily forget to connect an output and get unexpected results.

I tend to think that benefits outweigh drawbacks in this case; but this is
up for discussion.

Alex



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
orbeon-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/orbeon-user

Reply via email to