Using Stylesheet Elements

XSL defines about twenty elements for transforming XML documents. So far, you have seen the <xsl:template> element for defining template rules and the <xsl:apply- templates> and <xsl:value-of> rules for including data in the output document.

Many transformations can be defined just using these three elements. However, some of the more complex requirements require additional support from XSL.

Processing Whitespace and Text

By default, an XSL transformation retains the whitespace in the original document. This may not be required for the following reasons:

  • The whitespace is generally ignored when processing the output.

  • Users browsing the transformed document may find the whitespace misleading or annoying.

  • Some output document ...

Get Sams Teach Yourself J2EE™ in 21 Days, Second 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.