- From: Jostein Austvik Jacobsen <josteinaj@gmail.com>
- Date: Mon, 27 May 2013 15:34:05 +0200
- To: XProc Dev <xproc-dev@w3.org>
- Message-ID: <CAOCxfQdVjNUWLpov8o86uw=QE3ncn0BEs-_Q16LdUM5c2oXFTg@mail.gmail.com>
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? Jostein
Received on Monday, 27 May 2013 13:34:59 UTC