home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1999 November / PCONLINE_11_99.ISO / filesbbs / OS2 / APCHSSL2.ZIP / OS2HTTPD / public / htdocs / xml / test2.xsl < prev    next >
Encoding:
Extensible Markup Language  |  1999-02-08  |  1.6 KB  |  51 lines

  1. <?xml version="1.0"?> 
  2.  
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl" 
  4.                 xmlns:lotusxsl="http://xsl.lotus.com/">
  5.  
  6.   <!-- Root xsl:template - start processing here -->
  7.   <xsl:template match="/">
  8.     <HTML>
  9.       <HEAD>
  10.         <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  11.         <META http-equiv="Expires" content="0"/>
  12.       </HEAD>
  13.       <BODY>
  14.         <H1>General Pattern Match Test</H1>
  15.         <P>Should show table with Column and row headings underlined, and 
  16.         the row marked critical in yellow background.</P>
  17.             <xsl:apply-templates/>
  18.       </BODY>
  19.     </HTML>
  20.   </xsl:template>
  21.  
  22.   <!-- document xsl:template -->
  23.   <xsl:template match="*" priority="-1">
  24.       <xsl:apply-templates/>
  25.   </xsl:template>
  26.  
  27.   <xsl:template match="table">
  28.       <TABLE><xsl:apply-templates/></TABLE>
  29.   </xsl:template>
  30.   
  31.   <xsl:template match="table/row">
  32.       <TR><xsl:apply-templates/></TR>
  33.   </xsl:template>
  34.  
  35.   <xsl:template match="table/row[@test='critical']">
  36.       <TR style="background-color:yellow"><xsl:apply-templates/></TR>
  37.   </xsl:template>
  38.   
  39.   <xsl:template match="table/row/empty-cell | column-header-cell | cell">
  40.       <TD><xsl:apply-templates/></TD>
  41.   </xsl:template>
  42.  
  43.   <xsl:template match="row[first-of-type()]/column-header-cell" priority="1">
  44.       <TH><SPAN style="text-decoration:underline"><xsl:apply-templates/></SPAN></TH>
  45.   </xsl:template>
  46.  
  47.   <xsl:template match="cell[first-of-type()]" priority="1">
  48.       <TH><SPAN style="text-decoration:underline"><xsl:apply-templates/></SPAN></TH>
  49.   </xsl:template>
  50.   
  51. </xsl:stylesheet>