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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.