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

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 UTC