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

Re: Compute attribute value with set-attribute

From: Florent Georges <fgeorges@gmail.com>
Date: Tue, 7 Apr 2009 16:27:44 +0200
Message-ID: <ebaca5bf0904070727p41ffa272v88afba8cf20b6584@mail.gmail.com>
To: Toman_Vojtech@emc.com
Cc: xproc-dev@w3.org
2009/4/7 ? wrote:

> In the first example, you have to use p:empty because there is no
> default readable port in p:add-attribute (because you are using
> p:declare-step with no input port for the top-level pipeline).

  Thanks!  I think I got it now.  I think I mixed up the source for
the step and for the with-option.  The following example shows the
difference between both:

    <p:identity>
       <p:input port="source">
          <p:inline>
             <what>world</what>
          </p:inline>
       </p:input>
    </p:identity>

    <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="
           concat('Hello, ', what, '!')"/>
    </p:add-attribute>

    ==>

    <elem a="Hello, world!"/>

  Thanks!  Regards,

-- 
Florent Georges
http://www.fgeorges.org/
Received on Tuesday, 7 April 2009 14:28:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 7 April 2009 14:28:26 GMT