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

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