Name

xsl:text

Synopsis

<xsl:text
   disable-output-escaping = "yes" | "no"> 
  <! --  #PCDATA  -- >
</xsl:text>

The xsl:text instruction is used inside templates to indicate that its contents should be output as text. Its contents are pure text, not elements. If the contents are composed exclusively of whitespace, then that whitespace is copied literally into the output document, rather than being stripped as it would be, by default, in most other elements.

Attribute

disable-output-escaping, optional

Setting the disable-output-escaping attribute to yes indicates that characters such as < and &—which are normally replaced by entity or character references such as &lt; or &#x3C;—should instead be output as the literal characters themselves. Note that the xsl:text element’s content in the stylesheet must still be well-formed, and any < or & characters must be written as &lt;, &amp;, or the equivalent character references. However, when the output document is serialized, these references are replaced by the actual represented characters rather than references that represent them.

Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.