W3C home > Mailing lists > Public > xproc-dev@w3.org > April 2009

Compute attribute value with set-attribute

From: Florent Georges <fgeorges@fgeorges.org>
Date: Mon, 6 Apr 2009 23:12:30 +0200
Message-ID: <ebaca5bf0904061412u745b9ba5s317ea5eb73624e6e@mail.gmail.com>
To: XProc Dev <xproc-dev@w3.org>
  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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 6 April 2009 21:13:06 GMT