sequence of documents bug

2.2 says:

Each input and output is declared to accept or produce either a single
document or a sequence of documents. It is not an error to connect a port
that is declared to produce a sequence of documents to a port that is
declared to accept only a single document. It is, however, an error if the
former step actually produces more than one document at run time.

So if my step1 produces a sequence of documents and my step2 input cannot
handle a sequence of documents, then an error should be thrown.

Consider this pipeline:

<p:declare-step xmlns:p="" name="myPipeline">
    <p:input port="source">
        <p:document href="BookStore.xml"/>
    <p:output port="result">

    <p:filter select="//Book"/>
    <p:store href="help.xml"/>

I believe p:filter is producing a sequence of documents.  I believe p:store
cannot handle a sequence of documents.  But no error is thrown.  Calabash
0.6.2 creates the output file (help.xml) and stores the first document (the
first Book element in BookStore), like such:

<?xml version="1.0" encoding="UTF-8"?>
        <Title>My Life and Times</Title>
        <Author>Paul McCartney</Author>
        <Publisher>McMillin Publishing</Publisher>

Here's the result in my terminal window:

java com.xmlcalabash.Main -a pipe.xpl
Running p:filter
Running p:store

I think this is a bug.

James Garriss

Received on Friday, 26 September 2008 19:52:27 UTC