Initialize a variable with a parameter port

  Hi,

  I try to get a parameter value in a variable, by connecting the
variable context to a prameters port and using an expression like
"/c:param-set/c:param[...]/@value".  But Calabash gives me the
following error:

    err:XD0008 : More than one document in context for parameter
    'first' It is a dynamic error if a document sequence appears
    where a document to be used as the context node is expected.

  I use Calabash 0.9.40.  A complete repro is:

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
                xmlns:c="http://www.w3.org/ns/xproc-step"
                xmlns:my="http://example.org/xproc/params/try"
                version="1.0">

   <p:output port="result" primary="true"/>

   <p:declare-step type="my:params-try" name="me">
      <p:input port="params" kind="parameter"/>
      <p:output port="result" primary="true"/>
      <!-- get a param value -->
      <p:variable name="first" select="/c:param-set/c:param[1]/@value">
         <p:pipe step="me" port="params"/>
      </p:variable>
      <!-- use it in some visible way -->
      <p:template>
         <p:input port="source">
            <p:empty/>
         </p:input>
         <p:input port="template">
            <p:inline>
               <root>Param: { $p }</root>
            </p:inline>
         </p:input>
         <p:with-param name="p" select="$first"/>
      </p:template>
   </p:declare-step>

   <my:params-try>
      <p:input port="params">
         <p:inline>
            <c:param-set>
               <c:param name="un" value="one"/>
            </c:param-set>
         </p:inline>
      </p:input>
   </my:params-try>

</p:declare-step>

  Any idea?

  Regards,

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/

Received on Monday, 21 November 2011 17:52:38 UTC