Re: Use Case 5.15: Parse and/or Serialize RSS descriptions

Alessandro Vernet wrote:
> 
> Alex,
> 
> 1) In <p:step kind="p:parse">, you have <p:output name="parse"
> from="result"/>. I have a hard time understanding the meaning of that
> from="result". I assumed that from="..." is a reference to a label
> declared somewhere else. But I don't see any other "result" in this
> pipeline. Then again, my assumption may be incorrect.

The component defines an output called 'result'.  That element maps
that output name to a name that can be referenced in the pipeline.

> 2) In the <p:for-each>, you have <p:output name="final"
> from="parse"/>. Is this a reference to the "parse" output of the step
> <p:step kind="p:parse">? What if in the iteration there are multiple
> steps with an output named "step"? Maybe you meant to write:
> 
>    <p:for-each select="description" over="feed" to="iteration">
>        <p:output name="final" from="result"/>
>        <p:step kind="p:parse">
>            <p:input name="document" from="iteration"/>
>            <p:output name="parse" label="result"/>
>            ...
>        </p:step>
>    </p:for-each>

There is a flaw in this pipeline that doesn't match my current
version of this pipeline spec.  I'll resend the examples.

> 3) In this example, the output "processed-feed" of the pipeline is a
> sequence of documents, and in general, <p:for-each> always returns a
> sequence of document with one document per iteration. Is this
> understanding correct?

In this case, the for-each is iterating over sub-trees.  It takes each
matching element and makes a temporary document out of that for
the contained steps where that temporary document is labeled with
the input label specified in 'to'.

The missing bit was the 'replacement' attribute that I sent out in
some corrected examples.  The replacement attribute specifies an
output label for one of the contained steps.  The document element of
that output will be the replacement element for the input's subtree.

In general:

    For each matching element:
       A. Make a temporary document whose document element is the
          current item from the element sequence.
       B. Assign that temporary document to the input label.
       C. "Execute" the sub-steps.
       D. Find the output document named by the 'replacement'
          attribute value.
       E. Replace the element in the original input with the
          document element of that output.

--Alex Milowski

Received on Thursday, 13 July 2006 01:02:24 UTC