stm:append-textstm:append-text
STM by Example
Home > Books > Tutorials and Training Guides > STM Language > stm:append-text

Rate this page:
Really useful
Satisfactory
Not helpful
Confusing
Incorrect
Unsure
Extra comments:



Attribute
xpathrequired the target path into the operand document
selectoptional the target path into the operand document

The stm:append-text operation is used to append text to an element or attribute located by an xpath. The value to be set is obtained from the select xpath location of the enclosed fragment. If the xpath value returns multiple targets the text is appended to all.

Example

Example 1: Append a fragment

This example appends the text entity to the food attribute of the first <c> element.

<idoc>
  <seq>
    <instr>
      <type>stm</type>
      <operand>doc.xml</operand>
      <operator>
        <stm:group xmlns:stm="http://1060.org/stm">
          <stm:append-text select="." xpath="/a/b[1]/c/@food">stack</stm:append-text>
        </stm:group>
      </operator>
      <target>this:response</target>
    </instr>
  </seq>
</idoc>

Try it

© 2003-2007, 1060 Research Limited. 1060 registered trademark, NetKernel trademark of 1060 Research Limited.