Compute attribute value with set-attribute

  Hi,

  I want to set an attribute on an element using an XPath
expression.  So I use the step p:add-attribute, with a
p:with-option for the attribute-value option:

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

       <p:output port="result"/>

       <p:add-attribute match="elem" attribute-name="a">
          <p:input port="source">
             <p:inline>
                <elem/>
             </p:inline>
          </p:input>
          <p:with-option name="attribute-value" select="'value'"/>
       </p:add-attribute>

    </p:declare-step>

but I get an error running this pipeline:

    Error : .../bug-calabash.xproc:15: option attribute-value
    unbound on p:add-attribute step named #ANON.86 and no default
    readable port.

  If I set the option through the attribute:

    <p:add-attribute match="elem" attribute-name="a" attribute-value="value">
       <p:input port="source">
          <p:inline>
             <elem/>
          </p:inline>
       </p:input>
    </p:add-attribute>

everything runs fine and I get the expected result:

    <elem a="value"/>

  I use Calabash 0.9.7.  Did I miss something obvious with the
step p:set-attribute or with options?

  Regards,

-- 
Florent Georges
http://www.fgeorges.org/

Received on Monday, 6 April 2009 21:13:05 UTC