home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / building / xmlspy / xmlspyentcomplete5.exe / Data1.cab / _6CC22FA996194F338246E440548E6A81 < prev    next >
Encoding:
Extensible Markup Language  |  2002-09-04  |  5.1 KB  |  179 lines

  1. <?xml version='1.0'?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3.                 version='1.0'>
  4.  
  5. <!-- ********************************************************************
  6.      $Id: index.xsl,v 1.1.2.1 2002/09/04 13:50:33 jdj Exp $
  7.      ********************************************************************
  8.  
  9.      This file is part of the XSL DocBook Stylesheet distribution.
  10.      See ../README or http://nwalsh.com/docbook/xsl/ for copyright
  11.      and other information.
  12.  
  13.      ******************************************************************** -->
  14.  
  15. <!-- ==================================================================== -->
  16.  
  17. <xsl:template match="index|setindex">
  18.   <!-- some implementations use completely empty index tags to indicate -->
  19.   <!-- where an automatically generated index should be inserted. so -->
  20.   <!-- if the index is completely empty, skip it. Unless generate.index -->
  21.   <!-- is non-zero, in which case, this is where the automatically -->
  22.   <!-- generated index should go. -->
  23.  
  24.   <xsl:if test="count(*)>0 or $generate.index != '0'">
  25.     <div class="{name(.)}">
  26.       <xsl:if test="$generate.id.attributes != 0">
  27.         <xsl:attribute name="id">
  28.           <xsl:call-template name="object.id"/>
  29.         </xsl:attribute>
  30.       </xsl:if>
  31.  
  32.       <xsl:call-template name="anchor"/>
  33.       <xsl:call-template name="index.titlepage"/>
  34.       <xsl:apply-templates/>
  35.  
  36.       <xsl:if test="count(indexentry) = 0 and count(indexdiv) = 0">
  37.         <xsl:call-template name="generate-index"/>
  38.       </xsl:if>
  39.  
  40.       <xsl:call-template name="process.footnotes"/>
  41.     </div>
  42.   </xsl:if>
  43. </xsl:template>
  44.  
  45. <xsl:template match="index/title"></xsl:template>
  46. <xsl:template match="index/subtitle"></xsl:template>
  47. <xsl:template match="index/titleabbrev"></xsl:template>
  48.  
  49. <xsl:template match="index/title" mode="component.title.mode">
  50.   <h2 class="title">
  51.     <xsl:apply-templates/>
  52.   </h2>
  53. </xsl:template>
  54.  
  55. <xsl:template match="index/subtitle" mode="component.title.mode">
  56.   <h3>
  57.     <i><xsl:apply-templates/></i>
  58.   </h3>
  59. </xsl:template>
  60.  
  61. <!-- ==================================================================== -->
  62.  
  63. <xsl:template match="indexdiv">
  64.   <div class="{name(.)}">
  65.     <xsl:if test="$generate.id.attributes != 0">
  66.       <xsl:attribute name="id">
  67.         <xsl:call-template name="object.id"/>
  68.       </xsl:attribute>
  69.     </xsl:if>
  70.  
  71.     <xsl:call-template name="anchor"/>
  72.     <xsl:apply-templates mode="not-indexentrys"/>
  73.     <dl>
  74.       <xsl:apply-templates select="indexentry"/>
  75.     </dl>
  76.   </div>
  77. </xsl:template>
  78.  
  79. <xsl:template match="indexentry" mode="not-indexentrys">
  80.   <!-- suppress -->
  81. </xsl:template>
  82.  
  83. <xsl:template match="indexdiv/title">
  84.   <h3 class="{name(.)}">
  85.     <xsl:apply-templates/>
  86.   </h3>
  87. </xsl:template>
  88.  
  89. <!-- ==================================================================== -->
  90.  
  91. <xsl:template match="indexterm">
  92.   <!-- this one must have a name, even if it doesn't have an ID -->
  93.   <xsl:variable name="id">
  94.     <xsl:call-template name="object.id"/>
  95.   </xsl:variable>
  96.  
  97.   <a class="indexterm" name="{$id}"/>
  98. </xsl:template>
  99.  
  100. <xsl:template match="primary|secondary|tertiary|see|seealso">
  101. </xsl:template>
  102.  
  103. <!-- ==================================================================== -->
  104.  
  105. <xsl:template match="indexentry">
  106.   <xsl:apply-templates select="primaryie"/>
  107. </xsl:template>
  108.  
  109. <xsl:template match="primaryie">
  110.   <dt>
  111.     <xsl:apply-templates/>
  112.   </dt>
  113.   <xsl:choose>
  114.     <xsl:when test="following-sibling::secondaryie">
  115.       <dd>
  116.         <dl>
  117.           <xsl:apply-templates select="following-sibling::secondaryie"/>
  118.         </dl>
  119.       </dd>
  120.     </xsl:when>
  121.     <xsl:when test="following-sibling::seeie
  122.                     |following-sibling::seealsoie">
  123.       <dd>
  124.         <dl>
  125.           <xsl:apply-templates select="following-sibling::seeie
  126.                                        |following-sibling::seealsoie"/>
  127.         </dl>
  128.       </dd>
  129.     </xsl:when>
  130.   </xsl:choose>
  131. </xsl:template>
  132.  
  133. <xsl:template match="secondaryie">
  134.   <dt>
  135.     <xsl:apply-templates/>
  136.   </dt>
  137.   <xsl:choose>
  138.     <xsl:when test="following-sibling::tertiaryie">
  139.       <dd>
  140.         <dl>
  141.           <xsl:apply-templates select="following-sibling::tertiaryie"/>
  142.         </dl>
  143.       </dd>
  144.     </xsl:when>
  145.     <xsl:when test="following-sibling::seeie
  146.                     |following-sibling::seealsoie">
  147.       <dd>
  148.         <dl>
  149.           <xsl:apply-templates select="following-sibling::seeie
  150.                                        |following-sibling::seealsoie"/>
  151.         </dl>
  152.       </dd>
  153.     </xsl:when>
  154.   </xsl:choose>
  155. </xsl:template>
  156.  
  157. <xsl:template match="tertiaryie">
  158.   <dt>
  159.     <xsl:apply-templates/>
  160.   </dt>
  161.   <xsl:if test="following-sibling::seeie
  162.                 |following-sibling::seealsoie">
  163.     <dd>
  164.       <dl>
  165.         <xsl:apply-templates select="following-sibling::seeie
  166.                                      |following-sibling::seealsoie"/>
  167.       </dl>
  168.     </dd>
  169.   </xsl:if>
  170. </xsl:template>
  171.  
  172. <xsl:template match="seeie|seealsoie">
  173.   <dt>
  174.     <xsl:apply-templates/>
  175.   </dt>
  176. </xsl:template>
  177.  
  178. </xsl:stylesheet>
  179.