W3C home > Mailing lists > Public > xproc-dev@w3.org > November 2011

Initialize a variable with a parameter port

From: Florent Georges <fgeorges@fgeorges.org>
Date: Mon, 21 Nov 2011 18:51:45 +0100
Message-ID: <CADyR_r1RpWqGKP-0U_Zwzpdcmu=iNa9mEA37moGLwqUWY5hUiw@mail.gmail.com>
To: XProc Dev <xproc-dev@w3.org>
  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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 21 November 2011 17:52:38 GMT