RE: variable with select gives err XD0008 in Calabash

Hi Kevin,

This is an interesting one. That you get XD0008 is probably because something changed in Calabash wrt p:pipe and reading from parameter input ports. It looks like p:pipe was returning a single c:param-set document in the previous versions, but now it returns a sequence of c:param documents.

>From the XProc perspective, both c:param-set and a sequence of c:param are equivalent ways for representing and passing along parameters to steps. XPath expressions, however, is a completely different story: there you want to have complete control over what the context item looks like.

I could not find anything in the XProc specification that would mandate how parameters should be represented when you read them using p:pipe. I think that this is completely implementation-dependent. If you want to have more control, use the p:parameters step, where the spec explicitly says that the parameters will be represented as a c:param-set document.

What I would do would be to process the parameters using p:parameters first, and use the result of the p:parameters step as the XPath context.

Regards,
Vojtech



-----Původní zpráva-----
Od: xproc-dev-request@w3.org za uživatele Kevin Flynn
Odesláno: po 12.7.2010 14:32
Komu: xproc-dev@w3.org; Norman Walsh
Předmět: p:variable with select gives err XD0008 in Calabash
 
Hi,

Setting a variable like this:

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"

xmlns:eb="http://xmlns.escenic.com/2009/xproc/easybook-pipes"

xmlns:ebl="http://xmlns.escenic.com/2009/xproc/easybook-library"

xmlns:ebd="http://xmlns.escenic.com/2009/easybook/pipeline-data"
                  xmlns:c="http://www.w3.org/ns/xproc-step"
                  name="run-pipe"
                  version="1.0">

<p:input port="source"/>
<p:input port="par" kind="parameter"/>
<p:output port="result">
<p:pipe step="end-of-pipe" port="result"/>
</p:output>

<p:variable name="pipeline"
select="/c:param-set/c:param[@name='pipeline']/@value">
<p:pipe step="run-pipe" port="par"/>
</p:variable>

....

</p:declare-step>

worked in Calabash 0.9.16, but fails with:

:err:XD0008:More than one document in context for parameter 'pipeline'

in Calabash 0.9.21.

The select statement in the p:variable element should only return one
node - the source document looks like this:

<c:param-set xmlns:c="http://www.w3.org/ns/xproc-step">
<c:param name="pipeline" value="ebk-fo"/>
<c:param name="input-file"
value="file:///home/kevin/main-ws/branches/personal/kevin/ebk/syndication-ref.ebk"/>
<c:param name="output-folder"
value="file:///home/kevin/main-ws/branches/personal/kevin/ebk/out"/>
<c:param name="output-file-stem" value="syndication-ref"/>
<c:param name="version" value="5.0-8"/>
</c:param-set>

My question is: has an error been introduced into Calabash, or is the
new behavior correct, and I've been using a loophole that is now closed.
As far as I can tell from the spec it should work, but the spec is not
light reading...

Thanks for your attention!

Kevin Flynn
Vizrt
Oslo, Norway

Received on Monday, 12 July 2010 14:51:39 UTC