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

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

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

Hi Folks,

In this pipeline BookStore.xml is stored to a different file depending on the number of Book elements in it:


<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" sequence="true">
            <p:empty/>
        </p:output>
    
    <p:choose name="step1">
        <p:when test="count(//Book)&gt;1">
            <p:store href="multipleBooks.xml"/>
        </p:when>
        <p:when test="count(//Book)=1">
            <p:store href="singleBook.xml"/>
        </p:when>
        <p:otherwise>
            <p:store href="noBook.xml"/>
        </p:otherwise>
    </p:choose>
</p:declare-step>


Note that the output of the pipeline is empty.


How do I connect the pipeline's p:output to p:choose, so that the pipeline output's is the file path of the stored document?

/Roger
Received on Sunday, 17 May 2009 12:54:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 17 May 2009 12:54:29 GMT