W3C home > Mailing lists > Public > xproc-dev@w3.org > May 2009

Re: How do I connect a step to the output of p:choose?

From: Costello, Roger L. <costello@mitre.org>
Date: Sun, 17 May 2009 17:33:29 -0400
To: "'xproc-dev@w3.org'" <xproc-dev@w3.org>
Message-ID: <9E51F88D5247B648908850C35A3BBB5003F3FE3771@IMCMBX3.MITRE.ORG>

Thanks a lot Norm. Per your suggestion, I added p:output to each branch of p:choose:

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" name="myPipeline">
        <p:input port="source">
            <p:document href="BookStore.xml"/>
        </p:input>
        <p:output port="result">
            <p:pipe step="choice" port="result" />
        </p:output>
    
    <p:choose name="choice">
        <p:when test="count(//Book)&gt;1">
            <p:output port="result">
                <p:pipe step="choice1" port="result" />
            </p:output>
            <p:store href="multipleBooks.xml" name="choice1" />
        </p:when>
        <p:when test="count(//Book)=1">
            <p:output port="result">
                <p:pipe step="choice2" port="result" />
            </p:output>
            <p:store href="singleBook.xml" name="choice2"/>
        </p:when>
        <p:otherwise>
            <p:output port="result">
                <p:pipe step="choice3" port="result" />
            </p:output>
            <p:store href="noBook.xml" name="choice3"/>
        </p:otherwise>
    </p:choose>
</p:declare-step>

Works great!

/Roger
Received on Sunday, 17 May 2009 21:34:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 17 May 2009 21:34:05 GMT