As I mentioned in the introduction, the goal of this chapter is to provide just enough information to allow you to be productive as quickly as possible with XSLT and AxKit. To that end, we will complete our whirlwind tour by looking at how XSLT can be used for several tasks that web developers are commonly asked to perform.
Your stylesheets work fine, but older HTML browsers are choking on
tags such as
xsl:output element and set its
method attribute to
<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html" /> . . .
xsl:output element offers an easy way to
control the formatting of the result of a given transformation. Other
valid values for the
method attribute include
“xml” (the default). This element
offers several other useful options, including the ability to set the
encoding of the result document (via the
attribute) and the ability to add a document type declaration to the
output (using the
You are transforming a document that consists of a long list of line items into HTML. You want to make the background of every other row a different color so that the page is more readable.
xsl:if element that tests the value of the current node’s position and conditionally adds the ...