W3C home > Mailing lists > Public > xproc-dev@w3.org > June 2013

Re: err:XD0008 (more than one document in context) when not referring to the context

From: James Fuller <james.fuller.2007@gmail.com>
Date: Mon, 3 Jun 2013 08:07:55 +0200
Message-ID: <CADsXk-a+a==PLS3Y1syREF0upjzkJQKXFKqCv+pSiYfskt8fdw@mail.gmail.com>
To: Jostein Austvik Jacobsen <josteinaj@gmail.com>
Cc: XProc Dev <xproc-dev@w3.org>
On Mon, May 27, 2013 at 3:34 PM, Jostein Austvik Jacobsen
<josteinaj@gmail.com> wrote:
> In XProc vNext; could it be allowed to have more than one document in the
> context of a p:with-option, p:with-param and p:variable as long as you don't
> refer to the context?
>
> I have a step with this signature:
>
> <p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
> xmlns:pxi="http://www.daisy.org/ns/pipeline/xproc/internal"
> type="pxi:daisy202-to-epub3-content" version="1.0">
>     <p:input port="content-flow" primary="true" sequence="true"/>
>     <p:input port="resolve-links-mapping"/>
>     <p:input port="ncc-navigation"/>
>     <p:output port="content" sequence="true" primary="true"/>
>     <p:output port="fileset" primary="false"/>
>
>     <p:option name="publication-dir" required="true"/>
>     <p:option name="content-dir" required="true"/>
>     <p:option name="daisy-dir" required="true"/>
> </p:declare-step>
>
> As you see, the primary input is a sequence. So when I call it, I have to
> do:
>
> <pxi:daisy202-to-epub3-content>
>     <p:with-option name="publication-dir" select="$publication-dir">
>         <p:empty/>
>     </p:with-option>
>     <p:with-option name="content-dir" select="$content-dir">
>         <p:empty/>
>     </p:with-option>
>     <p:with-option name="daisy-dir" select="$daisy-dir">
>         <p:empty/>
>     </p:with-option>
> </pxi:daisy202-to-epub3-content>
>
> As a script author I would expect that as long as I don't refer to the
> context in a select expression, it wouldn't matter what is in the context.
> (I didn't realize this until I encountered an input fileset resulting in
> that multiple documents appeared on the steps input port, which means this
> has been a bug in my script for a long time.)
>
> This should have been sufficient:
>
> <pxi:daisy202-to-epub3-content>
>     <p:with-option name="publication-dir" select="$publication-dir"/>
>     <p:with-option name="content-dir" select="$content-dir"/>
>     <p:with-option name="daisy-dir" select="$daisy-dir"/>
> </pxi:daisy202-to-epub3-content>
>
> I find it strange that if there is no documents in the context it is only an
> error if you try to refer to the context, while if there is multiple
> documents in the context it is an error even if you don't refer to the
> context.
>
> What do you think?

just an ack that I will make sure this gets onto agenda for discussion.

Jim Fuller
>
> Jostein
Received on Monday, 3 June 2013 06:08:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:17:11 UTC