1 2<html xsl:version="1.0" 3xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 4lang="en"> 5<head> 6<title>Sales Results By Division</title> 7</head> 8<body> 9<table border="1"> 10<tr> 11<th>Division</th> 12<th>Revenue</th> 13<th>Growth</th> 14<th>Bonus</th> 15</tr> 16<xsl:for-each select="sales/division"> 17<!-- order the result by revenue --> 18<xsl:sort select="revenue" 19data-type="number" 20order="descending"/> 21<tr> 22<td> 23<em><xsl:value-of select="@id"/></em> 24</td> 25<td> 26<xsl:value-of select="revenue"/> 27</td> 28<td> 29<!-- highlight negative growth in red --> 30<xsl:if test="growth < 0"> 31<xsl:attribute name="style"> 32<xsl:text>color:red</xsl:text> 33</xsl:attribute> 34</xsl:if> 35<xsl:value-of select="growth"/> 36</td> 37<td> 38<xsl:value-of select="bonus"/> 39</td> 40</tr> 41</xsl:for-each> 42</table> 43</body> 44</html> 45