Example 2: Set with value from Param
In this example we introduce param substitution. Any element named
<stm:param> within an stm operation element is substituted by the
document fragment from the parameter document at the location given by the
<stm:param> xpath attribute. As is always the case for any URA the param
document is passed to the stm operation by the <param> element of the
idoc instruction.
In detail, this example sets the value of /a/[b]/c to the value at /i/j[1]/k
that is it sets horse to haddock!
<idoc> <seq> <instr> <type>stm</type> <operand>vardoc.xml</operand> <operator> <stm:group xmlns:stm="http://1060.org/stm"> <stm:set select="/i/j[1]/k" xpath="/a/b[1]/c"> <stm:param xpath="/*" /> </stm:set> </stm:group> </operator> <param>varparam.xml</param> <target>this:response</target> </instr> </seq> </idoc>
Try it
 |