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

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.

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>

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?

Alex

On 7/5/06, Alex Milowski <alex@milowski.org> wrote:
> The use case is here:
>
>   http://www.w3.org/TR/xproc-requirements/#use-case-rss-descriptions
>
> Parsing descriptions looks like:
>
> <p:pipeline xmlns:p='http://www.w3.org/2006/XProc'
>          xmlns:c='http://www.w3.org/2006/XProc/Components'
>          xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
>          xsi:schemaLocation='http://www.w3.org/2006/XProc pipeline.xsd'
>          xmlns:xhtml='http://www.w3.org/1999/xhtml'
>
> xmlns:t="http://www.smallx.com/Vocabulary/Services/Tideinfo/2005/1/0"
>          xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
>     <p:input name="feed"/>
>     <p:output name="processed-feed" from="final"/>
>
>     <!-- parse the children of the RSS description elements so that it
> can be processed
>          with XML tools -->
>     <p:for-each select="description" over="feed" to="iteration">
>        <p:output name="final" from="parse"/>
>        <p:step kind="p:parse">
>           <p:input name="document" from="iteration"/>
>           <p:output name="parse" from="result"/><!-- Note: the component
> names this -->
>           <p:parameter name="type" value="html"/>
>           <p:parameter name="children" value="true"/>
>           <p:parameter name="default-namespace"
> value="http://www.w3.org/1999/xhtml"/>
>        </p:step>
>     </p:for-each>
>
> </p:pipeline>
>
>
> Escaping (serializing) descriptions looks like:
>
> <p:pipeline xmlns:p='http://www.w3.org/2006/XProc'
>          xmlns:c='http://www.w3.org/2006/XProc/Components'
>          xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
>          xsi:schemaLocation='http://www.w3.org/2006/XProc pipeline.xsd'
>          xmlns:xhtml='http://www.w3.org/1999/xhtml'
>
> xmlns:t="http://www.smallx.com/Vocabulary/Services/Tideinfo/2005/1/0"
>          xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
>     <p:input name="feed"/>
>     <p:output name="processed-feed" from="final"/>
>
>     <!-- serialize the children of the description to be compliant with
> RSS -->
>     <p:for-each select="description" over="feed" to="iteration">
>        <p:output name="final" from="serialize"/>
>        <!-- serializes the children into a text node -->
>        <p:step kind="p:serialize">
>           <p:input name="document" from="iteration"/>
>           <p:output name="serialize" from="result"/><!-- Note: the
> component names this -->
>           <p:parameter name="children" value="true"/>
>        </p:step>
>     </p:for-each>
>
> </p:pipeline>
>
> --Alex Milowski
>
>
>


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

Received on Wednesday, 12 July 2006 23:21:40 UTC