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>

  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"

   <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"/>
      <!-- use it in some visible way -->
         <p:input port="source">
         <p:input port="template">
               <root>Param: { $p }</root>
         <p:with-param name="p" select="$first"/>

      <p:input port="params">
               <c:param name="un" value="one"/>


  Any idea?


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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:09 UTC