XSL reference documentation generated from the W3C Recommendation 16 November 1999


XSL element text

Creating Text

A template can also contain text nodes. Each text node in a template remaining after whitespace has been stripped as specified in strip will create a text node with the same string-value in the result tree. Adjacent text nodes in the result tree are automatically merged.

Note that text is processed at the tree level. Thus, markup of &lt; in a template will be represented in the stylesheet tree by a text node that includes the character <. This will create a text node in the result tree that contains a < character, which will be represented by the markup &lt; (or an equivalent character reference) when the result tree is externalized as an XML document (unless output escaping is disabled as described in disable-output-escaping).

<text>
  disable-output-escaping = yes | no
Model: #PCDATA
</text>

Literal data characters may also be wrapped in an xsl:text element. This wrapping may change what whitespace characters are stripped (see strip) but does not affect how the characters are handled by the XSLT processor thereafter.

Note: The xml:lang and xml:space attributes are not treated specially by XSLT. In particular,