Other Elements

Although space doesn’t permit me to cover every element in this chapter, there are a few notable elements. The following presents several useful elements, many of which you’ll see later in this book. Finally, please refer to Appendix A for a complete listing of all XSLT elements along with details on how to use them.

Adding Comments

Although a seemingly minor feature, the <xsl:comment> element allows you to create comment nodes that can be stored in the result tree. Why is this important? For one thing, comments created in the source document aren’t usually copied into the result tree. However, adding comments to a generated document can be extremely useful. Here’s a quick example:

 <xsl:comment> This style sheet generated for ...

Get Special Edition Using XSLT 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.