Example 7-7: Formatting alternating rows and conditionally hiding data

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <!-- Import all the templates from "TableBaseWithCSS.xsl" as a base -->
  <xsl:import href="TableBaseWithCSS.xsl"/>
  <!-- Match all ROWS in Top-Secret Department 20 -->
  <xsl:template match="ROW[ DEPTNO = 20 ]">
    <tr>
      <td align="center" colspan="{count(*)}">
        <table border="0">
          <tr>
            <td>Classified</td>
          </tr>
        </table>
      </td>
    </tr>
  </xsl:template>
  <!-- Match all even ROWS -->
  <xsl:template match="ROW[ position() mod 2 = 0 ]">
    <tr class="Even"><xsl:apply-templates/></tr>
  </xsl:template>
  <!-- Match all odd ROWS -->
  <xsl:template match="ROW[ position() mod 2 = 1 ]">
    <tr class="Odd"><xsl:apply-templates/></tr>
  </xsl:template>
</xsl:stylesheet>