RE: XS0006 necessary here?

> Beginner errors: when I execute (from the command line)
> <p:declare-step name="myPipeline"
>        xmlns:c="http://www.w3.org/ns/xproc-step"
>        xmlns:p="http://www.w3.org/ns/xproc">
> 	<p:identity>
> 		<p:input port="source">
> 			<p:inline>
> <c:directory><c:file name="aber.xml"/></c:directory>
> 			</p:inline>
> 		</p:input>
> 	</p:identity>
> 	<p:make-absolute-uris match="c:directory/*/@name">
> 		<p:with-option name="base-uri" 
> select="'file:/J:/test/'"/>
> 	</p:make-absolute-uris>
> </p:declare-step>
> then Calabash 0.9.14 gives me
> Error  : file:/J:/bauer/planavi/dirs/x-show-err1.xpl:4: Unbound
> primary output port on last step: myPipeline
> Error  : Pipeline failed: err:XS0006: Unbound primary output port on
> last step: myPipeline  It is a static error if the primary output port
> has no binding and the last step in the subpipeline does not have a
> primary output port.
> but Calumet 1.0.9 executes and outputs
> <c:directory xmlns:c="http://www.w3.org/ns/xproc-step"><c:file
> name="file:/J:/test/aber.xml"/></c:directory>

The current (28 May 2009) version of the XProc spec says (in Section
2.3): "Additionally, if a compound step has no declared outputs and the
last step in its subpipeline has an unbound primary output, then an
implicit primary output port will be added to the compound step (and
consequently the last step's primary output will be bound to it)."

This clearly the case with your pipeline: it declares no output ports,
but the last step in the sub-pipeline (p:make-absolute-uris) has an
unconnected primary output port (i.e. there is nothing that consumes the
result of the step). So according to the spec, the processors should add
an implicit primary output port to the main pipeline - which both seem
to have done.

In the case of Calumet, you seem to get the right behavior. However, in
the case of Calabash, the implicit primary output seems to cause
problems, at least judging based on err:XS0006 and the error message you
get ("Unbound primary output port on last step: myPipeline").

However, note that when the new version of the XProc specification is
published, the behavior related to adding implicit primary output ports
will change: it will not apply for step declarations (p:declare-step and
p:pipeline) any more as they will always have to specify all output
ports explicitly.

Regards,
Vojtech

--
Vojtech Toman
Principal Software Engineer
EMC Corporation
toman_vojtech@emc.com
http://developer.emc.com/xmltech

Received on Tuesday, 22 September 2009 07:46:14 UTC