W3C home > Mailing lists > Public > xproc-dev@w3.org > September 2008

sequence of documents bug

From: James Garriss <james@garriss.org>
Date: Fri, 26 Sep 2008 15:51:43 -0400
To: XProc Dev <xproc-dev@w3.org>
Message-ID: <C502B58F.AAF%james@garriss.org>
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="http://www.w3.org/ns/xproc" name="myPipeline">
    <p:input port="source">
        <p:document href="BookStore.xml"/>
    </p:input>
    <p:output port="result">
        <p:empty/>
    </p:output>

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

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"?>
    <Book>
        <Title>My Life and Times</Title>
        <Author>Paul McCartney</Author>
        <Date>1998</Date>
        <ISBN>1-56592-235-2</ISBN>
        <Publisher>McMillin Publishing</Publisher>
    </Book>

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
http://garriss.blogspot.com
Received on Friday, 26 September 2008 19:52:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 26 September 2008 19:52:27 GMT