6.5. The <xsl:text> Instruction Element

Another way to supplement the output result tree is to add text directly using the <xsl:text> element. While this can also be accomplished by typing text directly in the template, the <xsl:text> element serves to distinguish the actual text from other parts of the stylesheet. Sequences of <xsl:text> elements are sent to the output without any line breaks, making it possible to concatenate several strings. The <xsl:text> element, which has one optional attribute, disable-output-escaping, as shown in the following element model definition, can be used to output literal whitespace as well.

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

Get XSLT and XPATH: A Guide to XML Transformations 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.