Re: Compute attribute value with set-attribute

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 UTC