Text

The Text element can be used to enclose each string of output text:

<text>some text</text>

Yet the XML standard does not define an explicit construct for blocks of text within the markup. Text is simply allowed to appear at given points in the document structure, typically mixed with embedded elements. Similarly, text intended to appear in the output can simply appear at appropriate points within a template. The following examples are directly equivalent:

<TITLE><xsl:text>A Title</xsl:text></TITLE>


<TITLE>A Title</TITLE>

The Text element therefore appears to be superfluous. However, spaces are often used in the construction of stylesheets to make them more legible, and these spaces should not affect the output generated. The following ...

Get XSL companion, The 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.