home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / building / xmlspy / xmlspyentcomplete5.exe / Data1.cab / _CECF82E2BD2F48469AA24C1AFBF3A9B9 < prev    next >
Encoding:
Text File  |  2002-09-20  |  5.5 KB  |  195 lines

  1. <!--  task:xsl 1.1; 2002 May 8
  2.  | Specific override stylesheet for tasks (demo)
  3.  | This demonstrates the XSLT override mechanism tied to a specialization.
  4.  |
  5.  | Copyright IBM Corporation, 2002
  6.  | This file is part of the DITA package on IBM's developerWorks site.
  7.  | See license.txt for disclaimers.
  8.  *-->
  9.  
  10. <xsl:stylesheet version="1.0"
  11.      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  12.  
  13. <xsl:import href="topic2html.xsl"/>
  14.  
  15. <!-- XHTML output with XML syntax) -->
  16. <xsl:output method="xml"
  17.             encoding="iso-8859-1"
  18.             indent="yes"
  19.             doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
  20.             doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  21. />
  22.  
  23.  
  24. <xsl:template match="/">
  25.   <xsl:comment>Sample DITA task to HTML application by IBM Corp., 2002</xsl:comment>
  26.   <xsl:apply-templates/>
  27. </xsl:template>
  28.  
  29.  
  30. <!-- elements task and taskbody will fall through to topic processors -->
  31.  
  32.  
  33. <!-- == TASK UNIQUE SUBSTRUCTURES == -->
  34.  
  35. <xsl:template match="*[contains(@class,' task/prereq ')]">
  36.   <div>
  37.     <xsl:call-template name="setclass"/>
  38.     <xsl:apply-templates select="@id"/>
  39.     <xsl:apply-templates/>
  40.   </div>
  41. </xsl:template>
  42.  
  43. <xsl:template match="*[contains(@class,' task/context ')]">
  44.   <div>
  45.     <xsl:call-template name="setclass"/>
  46.     <xsl:apply-templates select="@id"/>
  47.     <xsl:call-template name="sect-heading">
  48.       <xsl:with-param name="deftitle">
  49.       </xsl:with-param>
  50.     </xsl:call-template>
  51.     <xsl:apply-templates/>
  52.   </div>
  53. </xsl:template>
  54.  
  55. <xsl:template match="*[contains(@class,' task/result ')]">
  56.   <div>
  57.     <xsl:call-template name="setclass"/>
  58.     <xsl:apply-templates select="@id"/>
  59.     <xsl:call-template name="sect-heading">
  60.       <xsl:with-param name="deftitle">
  61.       </xsl:with-param>
  62.     </xsl:call-template>
  63.     <xsl:apply-templates/>
  64.   </div>
  65. </xsl:template>
  66.  
  67. <xsl:template match="*[contains(@class,' task/postreq ')]">
  68.   <div>
  69.     <xsl:call-template name="setclass"/>
  70.     <xsl:apply-templates select="@id"/>
  71.     <xsl:call-template name="sect-heading">
  72.       <xsl:with-param name="deftitle">
  73.       </xsl:with-param>
  74.     </xsl:call-template>
  75.     <xsl:apply-templates/>
  76.   </div>
  77. </xsl:template>
  78.  
  79. <xsl:template match="*[contains(@class,' task/steps ')]">
  80.   <ol>
  81.     <xsl:call-template name="setclass"/>
  82.     <xsl:apply-templates select="@id"/>
  83.     <xsl:apply-templates/>
  84.   </ol>
  85. </xsl:template>
  86.  
  87. <xsl:template match="*[contains(@class,' task/step ')]">
  88.   <li>
  89.     <xsl:call-template name="setclass"/>
  90.     <xsl:apply-templates select="@id"/>
  91.     <xsl:if test="@importance='optional'">
  92.       <strong>
  93.       <xsl:call-template name="getString">
  94.         <xsl:with-param name="stringName" select="'Optional'"/>
  95.       </xsl:call-template><xsl:text>: </xsl:text>
  96.       </strong>
  97.     </xsl:if>
  98.     <xsl:if test="@importance='required'">
  99.       <strong>
  100.       <xsl:call-template name="getString">
  101.         <xsl:with-param name="stringName" select="'Required'"/>
  102.       </xsl:call-template><xsl:text>: </xsl:text>
  103.       </strong>
  104.     </xsl:if>
  105.     <xsl:apply-templates/>
  106.   </li>
  107. </xsl:template>
  108.  
  109. <xsl:template match="*[contains(@class,' task/substeps ')]">
  110.   <ol type="a">
  111.     <xsl:call-template name="setclass"/>
  112.     <xsl:apply-templates select="@id"/>
  113.     <xsl:apply-templates/>
  114.   </ol>
  115. </xsl:template>
  116.  
  117. <xsl:template match="*[contains(@class,' task/substep ')]">
  118.   <li>
  119.     <xsl:call-template name="setclass"/>
  120.     <xsl:apply-templates select="@id"/>
  121.     <xsl:if test="@importance='optional'">
  122.       <strong>
  123.       <xsl:call-template name="getString">
  124.         <xsl:with-param name="stringName" select="'Optional'"/>
  125.       </xsl:call-template><xsl:text>: </xsl:text>
  126.       </strong>
  127.     </xsl:if>
  128.     <xsl:if test="@importance='required'">
  129.       <strong>
  130.       <xsl:call-template name="getString">
  131.         <xsl:with-param name="stringName" select="'Required'"/>
  132.       </xsl:call-template><xsl:text>: </xsl:text>
  133.       </strong>
  134.     </xsl:if>
  135.     <xsl:apply-templates/>
  136.   </li>
  137. </xsl:template>
  138.  
  139. <xsl:template match="*[contains(@class,' task/choices ')]" priority="5">
  140.   <xsl:choose>
  141.     <xsl:when test="./*[contains(@class,' task/choice ')]">
  142.       <ul>
  143.         <xsl:call-template name="setclass"/>
  144.         <xsl:apply-templates select="@id"/>
  145.         <xsl:apply-templates/>
  146.       </ul>
  147.     </xsl:when>
  148.     <xsl:otherwise>
  149.       <table border="1" frame="hsides" rules="rows">
  150.         <xsl:apply-templates select="@id"/>
  151.         <thead>
  152.           <tr><td><b>Option</b></td><td><b>Description</b></td></tr>
  153.         </thead>
  154.         <tbody>
  155.           <xsl:apply-templates/>
  156.         </tbody>
  157.       </table>
  158.     </xsl:otherwise>
  159.   </xsl:choose>
  160. </xsl:template>
  161.  
  162. <xsl:template match="*[contains(@class,' task/choice ')]">
  163.   <li>
  164.     <xsl:call-template name="setclass"/>
  165.     <xsl:apply-templates select="@id"/>
  166.     <xsl:apply-templates/>
  167.   </li>
  168. </xsl:template>
  169.  
  170. <xsl:template match="*[contains(@class,' task/ifcond ')]">
  171.   <tr valign="top">
  172.     <xsl:call-template name="setclass"/>
  173.     <xsl:apply-templates select="@id"/>
  174.     <xsl:apply-templates/>
  175.   </tr>
  176. </xsl:template>
  177.  
  178. <xsl:template match="*[contains(@class,' task/issue ')]">
  179.   <td>
  180.     <xsl:call-template name="setclass"/>
  181.     <xsl:apply-templates select="@id"/>
  182.     <xsl:apply-templates/>
  183.   </td>
  184. </xsl:template>
  185.  
  186. <xsl:template match="*[contains(@class,' task/outcome ')]">
  187.   <td>
  188.     <xsl:call-template name="setclass"/>
  189.     <xsl:apply-templates select="@id"/>
  190.     <xsl:apply-templates/>
  191.   </td>
  192. </xsl:template>
  193.  
  194. </xsl:stylesheet>
  195.