Re: Here's a tricky one

/ Alessandro Vernet <avernet@orbeon.com> was heard to say:
| On 5/11/07, Norman Walsh <ndw@nwalsh.com> wrote:
|> Well, in this particular case, what I wanted was "value='$p:episode'",
|
| So you wanted to set the value of attributes '@episode' by the string
| $p:episode (not the value of that state variable)?

No, not exactly. Here's the step written "correctly":

<p:string-replace>
  <p:option name="match" value="@episode"/>
  <p:option name="replace" value="$p:episode"/>
</p:string-replace>

The "match" option gets the value '@episode' and the "replace" option
gets the value '$p:episode'.

That tells the implementation of the step to search for attributes named
episode and replace their value with the result of evaluating
"$p:episode" with the context node set to the selected attribute.

Steps that take fragments of XPath as options need to have the literal,
uninterpreted strings passed to them. The step will interpolate them
when it's running.

Tricky, eh? :-)

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | It's all fun and games until someone
http://nwalsh.com/            | loses an eye. Then it's just fun with a
                              | pirate.

Received on Monday, 14 May 2007 11:34:52 UTC