WebReference.com - Excerpt from Inside XSLT, Chapter 2, Part 3 (2/5) | WebReference

WebReference.com - Excerpt from Inside XSLT, Chapter 2, Part 3 (2/5)

To page 1current pageTo page 3To page 4To page 5
[previous] [next]

Inside XSLT

Literal Result Elements

If an element in a template body is not an XSL instruction or an extension element, then the XSLT processor must treat it as a literal result element. This means that an element must be treated literally and copied to the result tree (that is, copied to the output node tree created by the XSLT processor).

For example, in the following template body, the <TD> element is a literal result element, which will be copied to the output document:

<xsl:template match="RADIUS">
   <TD>RADIUS</TD>
</xsl:template>

Literal result elements may themselves have content, which is then treated as another template body and parsed by the XSLT processor. You'll see how this works later in this chapter.

Literal result elements may also have attributes, which are interpreted by the XSLT processor. For example, you can use the version attribute to specify that all XSLT elements inside a literal result element must be XSLT version 1.0 elements, as follows:

<xsl:template match="RADIUS">
   <TD xsl:version="1.0">RADIUS</TD>
</xsl:template>

The following list includes all the possible literal result element attributes (note that they're all optional):

Now it's time to put this information to work.


To page 1current pageTo page 3To page 4To page 5
[previous] [next]

Created: September 26, 2001
Revised: September 26, 2001


URL: https://webreference.com/authoring/languages/xml/insidexslt/chap2/3/2.html