Re: Where is my c:result?

This code

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" name="main">
    <p:input port="source" primary="true">
        <p:document href="Bookstore.xml"/>
    </p:input>
    <p:input port="alternate">
        <p:document href="BookStoreNoPub.xml"/>
    </p:input>
    <p:output port="result"/>
    <p:compare name="compare">
        <p:input port="source">
            <p:pipe step="main" port="source"/>
        </p:input>
        <p:input port="alternate">
            <p:pipe step="main" port="alternate"/>
        </p:input>
        <p:output port="result"/>  <!-- note here -->
    </p:compare>
</p:declare-step>

and this code

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" name="main">
    <p:input port="source" primary="true">
        <p:document href="Bookstore.xml"/>
    </p:input>
    <p:input port="alternate">
        <p:document href="BookStoreNoPub.xml"/>
    </p:input>
    <p:output port="result">
        <p:pipe step="compare" port="result"/>  <!-- note here -->
    </p:output>
    <p:compare name="compare">
        <p:input port="source">
            <p:pipe step="main" port="source"/>
        </p:input>
        <p:input port="alternate">
            <p:pipe step="main" port="alternate"/>
        </p:input>
    </p:compare>
</p:declare-step>

both work in Calabash 0.6.0 and both produce an identical result:

<c:result xmlns:c="http://www.w3.org/ns/xproc-step">false</c:result>

I suppose the former is wrong because the WD says in 5:4:  ³It is a static
error (err:XS0029) to specify a binding for a p:output inside a
p:declare-step for an atomic step.²

So why is the first way an error and the second ok?  They look about the
same to me.

James Garriss
http://garriss.blogspot.com




From: Norman Walsh <ndw@nwalsh.com>
Date: Fri, 19 Sep 2008 09:19:59 -0400
To: James Garriss <james@garriss.org>
Cc: XProc Dev <xproc-dev@w3.org>
Subject: Re: Where is my c:result?

James Garriss <james@garriss.org> writes:

> Excellent.  My mistake was assuming that p:compare had a primary output.
> What should have tipped me off as I read the spec?  Is it that primary
> equals false?  From the spec:

Yep, primary=false is the flag.

> <p:declare-step type="p:compare">
>      <p:input port="source" primary="true"/>
>      <p:input port="alternate"/>
>      <p:output port="result" primary="false"/>
>      <p:option name="fail-if-not-equal" select="'false'"/>         <!--
> boolean -->
> </p:declare-step>
>
> As to a working solution, you had the right idea, but as calabash informs
> us:  Attribute "step" not allowed on p:output.  Instead, we can put a result
> port in p:compare, like such:
>
>     <p:compare fail-if-not-equal="true" name="compareBookstores">
>         <p:input port="source">
>             <p:pipe step="main" port="source"/>
>         </p:input>
>         <p:input port="alternate">
>             <p:pipe step="main" port="alternate"/>
>         </p:input>
>         <p:output port="result"/>
>     </p:compare>

No, that's not right. You aren't allowed to put a p:output on an atomic
step. Does Calabash miss that too? Sigh. Another day, another bug :-)

The output port is part of the declaration of the p:compare step.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | A proof tells us where to concentrate
http://nwalsh.com/            | our doubts.-- Anonymous

Received on Friday, 19 September 2008 15:03:07 UTC