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

  1. <?xml version="1.0"?> 
  2.  
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  4.   <!-- Root xsl:template - start processing here -->
  5.   <xsl:template match="/">
  6.     <HTML>
  7.       <HEAD>
  8.         <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  9.         <META http-equiv="Expires" content="0"/>
  10.         <TITLE>        
  11.           <xsl:for-each select=".//teiHeader/fileDesc/titleStmt/title">
  12.           <DIV    style="font-size:18pt;font-family:Verdana;font-weight:bold">
  13.                 <xsl:apply-templates/>
  14.             </DIV>
  15.           </xsl:for-each>
  16.         </TITLE>
  17.       </HEAD>
  18.       <BODY>
  19.         <xsl:apply-templates select=".//titlePage"/><BR/>
  20.         <HR/>
  21.         <H1>Table of Contents</H1>
  22.         <xsl:for-each select="tei.2//head">
  23.       - <A href="#{@n}"><xsl:apply-templates/></A><BR/>
  24.         </xsl:for-each>
  25.         <xsl:apply-templates select="tei.2//body"/>
  26.       </BODY>
  27.     </HTML>
  28.   </xsl:template>
  29.   
  30.   <xsl:template match="titlePage/docTitle/titlePart">
  31.     <DIV    style="font-size:18pt;font-family:Verdana;font-weight:bold">
  32.       <xsl:apply-templates/></DIV>
  33.   </xsl:template>
  34.   
  35.   <xsl:template match="titlePage/docAuthor">
  36.     Author: <xsl:apply-templates/>
  37.   </xsl:template>
  38.  
  39.   <xsl:template match="titlePage/docDate">
  40.     <BR/>Document Date: <xsl:apply-templates/>
  41.   </xsl:template>
  42.  
  43.   <xsl:template match="head">
  44.     <A name="{@n}"><H2><xsl:apply-templates/></H2></A>
  45.   </xsl:template>
  46.  
  47.   <xsl:template match="div1">
  48.     <HR/>
  49.     <xsl:apply-templates/>
  50.   </xsl:template>
  51.   
  52.   <!-- <eg> contains a single short example of some technical topic 
  53.        being discussed, e.g. a code fragment or a sample of SGML encoding. --> 
  54.   <xsl:template match="eg">
  55.     <CODE><xsl:apply-templates/></CODE>
  56.   </xsl:template>
  57.  
  58.   <!-- <q> contains a quotation or apparent quotation. -->
  59.   <xsl:template match="q">
  60.     <Q><xsl:apply-templates/></Q>
  61.   </xsl:template>
  62.    
  63.   <!-- <gi> contains a special type of identifier: an SGML 
  64.       generic identifier, or element name. -->
  65.   <xsl:template match="gi">
  66.     <CODE><xsl:apply-templates/></CODE>
  67.   </xsl:template>
  68.  
  69.   <!-- <ident> contains an identifier of some kind, e.g. 
  70.        a variable name or the name of an SGML element or attribute.  -->
  71.   <xsl:template match="ident">
  72.     <CODE><xsl:apply-templates/></CODE>
  73.   </xsl:template>
  74.  
  75.   <xsl:template match="list[@type='bulleted']">
  76.     <UL><xsl:apply-templates/></UL>
  77.   </xsl:template>
  78.  
  79.   <xsl:template match="list[@type='simple']">
  80.     <UL TYPE="i"><xsl:apply-templates/></UL>
  81.   </xsl:template>
  82.  
  83.   <xsl:template match="list[@type='gloss']">
  84.     <DL><xsl:apply-templates/></DL>
  85.   </xsl:template>
  86.  
  87.   <xsl:template match="list[@type='gloss']/label">
  88.     <DT><xsl:apply-templates/></DT>
  89.   </xsl:template>
  90.  
  91.   <xsl:template match="list[@type='gloss']/item">
  92.     <DD><xsl:apply-templates/></DD>
  93.   </xsl:template>
  94.  
  95.   <xsl:template match="list[@type='ordered']">
  96.     <OL><xsl:apply-templates/></OL>
  97.   </xsl:template>
  98.  
  99.   <xsl:template match="list/item">
  100.     <LI><xsl:apply-templates/></LI>
  101.   </xsl:template>
  102.   
  103.   <!-- <code> contains a short fragment of code in some 
  104.   formal language (often a programming language). 
  105.   (He uses it for URLs, without identifying it as such via 
  106.   and attribute.  This should be fixed, I think. -->
  107.   <xsl:template match="code">
  108.     <A HREF="{.}"><xsl:apply-templates/></A>
  109.   </xsl:template>  
  110.  
  111.   <!-- <emph> marks words or phrases which are stressed or emphasized 
  112.        for linguistic or rhetorical effect. --> 
  113.   <xsl:template match="emph">
  114.     <EM><xsl:apply-templates/></EM>
  115.   </xsl:template>
  116.  
  117.   <!-- <soCalled> ... --> 
  118.   <xsl:template match="soCalled">
  119.     <I><xsl:apply-templates/></I>
  120.   </xsl:template>
  121.  
  122.   <!-- <term> contains a single-word, multi-word or symbolic 
  123.        designation which is regarded as a technical term. --> 
  124.   <xsl:template match="term">
  125.     <DFN><xsl:apply-templates/></DFN>
  126.   </xsl:template>
  127.  
  128.   <xsl:template match="note">
  129.     <SPAN style="border:1px solid black;color:teal;">[NOTE: <xsl:apply-templates/>]</SPAN>
  130.   </xsl:template>
  131.  
  132.   <xsl:template match="title">
  133.     <SPAN style="text-decoration:underline;"><xsl:apply-templates/></SPAN>
  134.   </xsl:template>
  135.  
  136.   <xsl:template match="p">
  137.     <P><xsl:apply-templates/></P>
  138.   </xsl:template>
  139.  
  140.   <xsl:template match="*" priority="-1">
  141.     <xsl:apply-templates/>
  142.   </xsl:template>
  143.   
  144.   <xsl:template match="teiHeader//*">
  145.   </xsl:template>
  146.   
  147. </xsl:stylesheet> 
  148.