home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1999 October / pcp156b.iso / alphawrk / TEXML / TEXML.ZIP / com / ibm / texml / ddochtml.xsl < prev    next >
Encoding:
Extensible Markup Language  |  1999-06-23  |  1.7 KB  |  88 lines

  1. <?xml version="1.0"?>
  2.  
  3. <xsl:stylesheet
  4.   xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">
  5.  
  6. <xsl:template match="/">
  7.   <xsl:apply-templates/>
  8. </xsl:template>
  9.  
  10. <xsl:template match="doc">
  11.   <HTML>
  12.     <head>
  13.       <title>
  14.         <xsl:value-of select="@title"/>
  15.       </title>
  16.     </head>
  17.     <body>
  18.       <h1><xsl:value-of select="@title"/></h1>
  19.       <xsl:apply-templates/>
  20.     </body>
  21.   </HTML>
  22. </xsl:template>
  23.  
  24. <xsl:template match="sec">
  25.   <h2><xsl:value-of select="@title"/></h2>
  26.   <xsl:apply-templates/>
  27. </xsl:template>
  28.  
  29. <xsl:template match="sec//sec">
  30.   <h3><xsl:value-of select="@title"/></h3>
  31.   <xsl:apply-templates/>
  32. </xsl:template>
  33.  
  34. <xsl:template match="sec//sec//sec">
  35.   <h4><xsl:value-of select="@title"/></h4>
  36.   <xsl:apply-templates/>
  37. </xsl:template>
  38.  
  39. <!-- Paragraphs -->
  40. <xsl:template match="p">
  41.  <p><xsl:apply-templates/></p>
  42. </xsl:template>
  43.  
  44. <!-- Quotations -->
  45. <xsl:template match="quote">
  46.  <xsl:text>"</xsl:text>
  47.  <xsl:apply-templates/>
  48.  <xsl:text>"</xsl:text>
  49. </xsl:template>
  50.  
  51. <!-- Bullet lists -->
  52. <xsl:template match="list">
  53.   <ul>
  54.   <xsl:apply-templates/>
  55.   </ul>
  56. </xsl:template>
  57.  
  58. <xsl:template match="item">
  59.   <li>
  60.   <xsl:apply-templates/>
  61.   </li>
  62. </xsl:template>
  63.  
  64. <!-- Descriptive lists -->
  65. <xsl:template match="list[@type='descriptive']">
  66.   <dl>
  67.   <xsl:apply-templates/>
  68.   </dl>
  69. </xsl:template>
  70.  
  71. <xsl:template match="item[@term]">
  72.   <dt>
  73.     <xsl:value-of select="@term"/>
  74.   </dt>
  75.   <dd>
  76.     <xsl:apply-templates/>
  77.   </dd>
  78. </xsl:template>
  79.  
  80. <!-- Simple one-way links -->
  81. <xsl:template match="link">
  82.   <a href="{@href}">
  83.   <xsl:value-of select="@href"/>
  84.   </a>
  85. </xsl:template>
  86.  
  87. </xsl:stylesheet>
  88.