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

  1. <?xml version="1.0"?> 
  2.  
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  4.  
  5.   <!-- Root xsl:template - start processing here -->
  6.   <xsl:template match="/">
  7.     <HTML>
  8.       <HEAD>
  9.         <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  10.         <META http-equiv="Expires" content="0"/>
  11.       </HEAD>
  12.       <BODY>
  13.         <H1>General funky test</H1>
  14.             <xsl:apply-templates/>
  15.       </BODY>
  16.     </HTML>
  17.   </xsl:template>
  18.  
  19.   <xsl:template match="doc/*" priority="1">
  20.     <HR/>
  21.       Rule1(<xsl:apply-templates/>)
  22.   </xsl:template>
  23.  
  24.   <xsl:template match="*" priority="-1">
  25.       Rule2(<xsl:apply-templates/>)
  26.   </xsl:template>
  27.  
  28.   <xsl:template match="emph">
  29.       Rule3(<EM><SPAN style="color:black">match="emph": </SPAN><xsl:apply-templates/></EM>)
  30.   </xsl:template>
  31.   
  32.   <xsl:template match="b//b2/emph" priority="1">
  33.       Rule4(<EM style="background-color:purple"><SPAN style="color:black">match="b//b2/emph": </SPAN>
  34.         <xsl:apply-templates/></EM>)
  35.   </xsl:template>
  36.  
  37.   <xsl:template match="a">
  38.       Rule5(<P style="color:blue"><EM style="color:black">match="a": </EM><xsl:apply-templates/></P>)
  39.   </xsl:template>
  40.  
  41.   <xsl:template match="a[emph]">
  42.       Rule6(<P style="color:blue; background-color:red"><EM style="color:black">match="a[emph]": </EM>
  43.       <xsl:apply-templates/></P>)
  44.   </xsl:template>
  45.  
  46.   <xsl:template match="c/a[emph]" priority="1">
  47.       Rule7(<P style="color:blue; background-color:gray"><EM style="color:black">match="c/a[emph]": 
  48.         </EM><xsl:apply-templates/></P>)
  49.   </xsl:template>
  50.  
  51.   <xsl:template match="a[@test='true']"  priority="2">
  52.       Rule8(<P style="color:green"><EM style="color:black">match="a[@test='true']": 
  53.         </EM><xsl:apply-templates/></P>)
  54.   </xsl:template>
  55.  
  56.   <xsl:template match="c/a" priority=".5">
  57.       Rule9(<P style="color:purple"><EM style="color:black">match="c/a": 
  58.         </EM><xsl:apply-templates/></P>)
  59.   </xsl:template>
  60.  
  61.   <xsl:template match="c/a[@test='true' and first-of-type()]" priority="3">
  62.       Rule10(<P style="color:yellow"><EM style="color:black">match="c/a[@test='true', first-of-type()]": 
  63.         </EM><xsl:apply-templates/></P>)
  64.   </xsl:template>
  65.  
  66. </xsl:stylesheet>
  67.