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

  1. <?xml version="1.0" encoding="US-ASCII"?>
  2. <!--This file was created automatically by html2xhtml-->
  3. <!--from the HTML stylesheets. Do not edit this file.-->
  4. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  5.  
  6. <!-- ==================================================================== -->
  7. <!-- Jeni Tennison gets all the credit for what follows.
  8.      I think I understand it :-) Anyway, I've hacked it a bit, so the
  9.      bugs are mine. -->
  10.  
  11. <xsl:key name="letter" match="indexterm" use="translate(substring(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), 1, 1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
  12.  
  13. <xsl:key name="primary" match="indexterm" use="normalize-space(concat(primary/@sortas, primary[not(@sortas)]))"/>
  14.  
  15. <xsl:key name="secondary" match="indexterm" use="concat(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), " ", normalize-space(concat(secondary/@sortas, secondary[not(@sortas)])))"/>
  16.  
  17. <xsl:key name="tertiary" match="indexterm" use="concat(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), " ", normalize-space(concat(secondary/@sortas, secondary[not(@sortas)])), " ", normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas)])))"/>
  18.  
  19. <xsl:key name="primary-section" match="indexterm[not(secondary) and not(see)]" use="concat(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), " ", generate-id((ancestor-or-self::set                      |ancestor-or-self::book                      |ancestor-or-self::part                      |ancestor-or-self::reference                      |ancestor-or-self::partintro                      |ancestor-or-self::chapter                      |ancestor-or-self::appendix                      |ancestor-or-self::preface                      |ancestor-or-self::section                      |ancestor-or-self::sect1                      |ancestor-or-self::sect2                      |ancestor-or-self::sect3                      |ancestor-or-self::sect4                      |ancestor-or-self::sect5                      |ancestor-or-self::refentry                      |ancestor-or-self::refsect1                      |ancestor-or-self::refsect2                      |ancestor-or-self::refsect3                      |ancestor-or-self::simplesect                      |ancestor-or-self::bibliography                      |ancestor-or-self::glossary                      |ancestor-or-self::index)[last()]))"/>
  20.  
  21. <xsl:key name="secondary-section" match="indexterm[not(tertiary) and not(see)]" use="concat(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), " ", normalize-space(concat(secondary/@sortas, secondary[not(@sortas)])), " ", generate-id((ancestor-or-self::set                      |ancestor-or-self::book                      |ancestor-or-self::part                      |ancestor-or-self::reference                      |ancestor-or-self::partintro                      |ancestor-or-self::chapter                      |ancestor-or-self::appendix                      |ancestor-or-self::preface                      |ancestor-or-self::section                      |ancestor-or-self::sect1                      |ancestor-or-self::sect2                      |ancestor-or-self::sect3                      |ancestor-or-self::sect4                      |ancestor-or-self::sect5                      |ancestor-or-self::refentry                      |ancestor-or-self::refsect1                      |ancestor-or-self::refsect2                      |ancestor-or-self::refsect3                      |ancestor-or-self::simplesect                      |ancestor-or-self::bibliography                      |ancestor-or-self::glossary                      |ancestor-or-self::index)[last()]))"/>
  22.  
  23. <xsl:key name="tertiary-section" match="indexterm[not(see)]" use="concat(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), " ", normalize-space(concat(secondary/@sortas, secondary[not(@sortas)])), " ", normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas)])), " ", generate-id((ancestor-or-self::set                      |ancestor-or-self::book                      |ancestor-or-self::part                      |ancestor-or-self::reference                      |ancestor-or-self::partintro                      |ancestor-or-self::chapter                      |ancestor-or-self::appendix                      |ancestor-or-self::preface                      |ancestor-or-self::section                      |ancestor-or-self::sect1                      |ancestor-or-self::sect2                      |ancestor-or-self::sect3                      |ancestor-or-self::sect4                      |ancestor-or-self::sect5                      |ancestor-or-self::refentry                      |ancestor-or-self::refsect1                      |ancestor-or-self::refsect2                      |ancestor-or-self::refsect3                      |ancestor-or-self::simplesect                      |ancestor-or-self::bibliography                      |ancestor-or-self::glossary                      |ancestor-or-self::index)[last()]))"/>
  24.  
  25. <xsl:key name="see-also" match="indexterm[seealso]" use="concat(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), " ", normalize-space(concat(secondary/@sortas, secondary[not(@sortas)])), " ", normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas)])), " ", seealso)"/>
  26.  
  27. <xsl:key name="see" match="indexterm[see]" use="concat(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), " ", normalize-space(concat(secondary/@sortas, secondary[not(@sortas)])), " ", normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas)])), " ", see)"/>
  28.  
  29. <xsl:key name="sections" match="*[@id]" use="@id"/>
  30.  
  31. <xsl:template name="generate-index">
  32.   <xsl:variable name="terms" select="//indexterm[count(.|key('letter',                                      translate(substring(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), 1, 1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'))[1]) = 1]"/>
  33.  
  34.   <xsl:variable name="alphabetical" select="$terms[contains(concat('abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),                                         substring(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), 1, 1))]"/>
  35.   <xsl:variable name="others" select="$terms[not(contains(concat('abcdefghijklmnopqrstuvwxyz',                                                  'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),                                              substring(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), 1, 1)))]"/>
  36.   <div xmlns="http://www.w3.org/1999/xhtml" class="index">
  37.     <xsl:if test="$others">
  38.       <div class="indexdiv">
  39.         <h3>
  40.           <xsl:call-template name="gentext">
  41.             <xsl:with-param name="key" select="'index symbols'"/>
  42.           </xsl:call-template>
  43.         </h3>
  44.         <dl>
  45.           <xsl:apply-templates select="$others[count(.|key('primary',                                        normalize-space(concat(primary/@sortas, primary[not(@sortas)])))[1]) = 1]" mode="index-symbol-div">
  46.             <xsl:sort select="normalize-space(concat(primary/@sortas, primary[not(@sortas)]))"/>
  47.           </xsl:apply-templates>
  48.         </dl>
  49.       </div>
  50.     </xsl:if>
  51.     <xsl:apply-templates select="$alphabetical[count(.|key('letter',                                  translate(substring(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), 1, 1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'))[1]) = 1]" mode="index-div">
  52.       <xsl:sort select="normalize-space(concat(primary/@sortas, primary[not(@sortas)]))"/>
  53.     </xsl:apply-templates>
  54.   </div>
  55. </xsl:template>
  56.  
  57. <xsl:template match="indexterm" mode="index-div">
  58.   <xsl:variable name="key" select="translate(substring(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), 1, 1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
  59.   <div xmlns="http://www.w3.org/1999/xhtml" class="indexdiv">
  60.     <h3>
  61.       <xsl:value-of select="translate($key, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
  62.     </h3>
  63.     <dl>
  64.       <xsl:apply-templates select="key('letter', $key)[count(.|key('primary', normalize-space(concat(primary/@sortas, primary[not(@sortas)])))[1]) = 1]" mode="index-primary">
  65.         <xsl:sort select="normalize-space(concat(primary/@sortas, primary[not(@sortas)]))"/>
  66.       </xsl:apply-templates>
  67.     </dl>
  68.   </div>
  69. </xsl:template>
  70.  
  71. <xsl:template match="indexterm" mode="index-symbol-div">
  72.   <xsl:variable name="key" select="translate(substring(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), 1, 1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
  73.   <xsl:apply-templates select="key('letter', $key)[count(.|key('primary', normalize-space(concat(primary/@sortas, primary[not(@sortas)])))[1]) = 1]" mode="index-primary">
  74.     <xsl:sort select="normalize-space(concat(primary/@sortas, primary[not(@sortas)]))"/>
  75.   </xsl:apply-templates>
  76. </xsl:template>
  77.  
  78. <xsl:template match="indexterm" mode="index-primary">
  79.   <xsl:variable name="key" select="normalize-space(concat(primary/@sortas, primary[not(@sortas)]))"/>
  80.   <xsl:variable name="refs" select="key('primary', $key)"/>
  81.   <dt xmlns="http://www.w3.org/1999/xhtml">
  82.     <xsl:value-of select="primary"/>
  83.     <xsl:for-each select="$refs[generate-id() = generate-id(key('primary-section', concat($key, " ", generate-id((ancestor-or-self::set                      |ancestor-or-self::book                      |ancestor-or-self::part                      |ancestor-or-self::reference                      |ancestor-or-self::partintro                      |ancestor-or-self::chapter                      |ancestor-or-self::appendix                      |ancestor-or-self::preface                      |ancestor-or-self::section                      |ancestor-or-self::sect1                      |ancestor-or-self::sect2                      |ancestor-or-self::sect3                      |ancestor-or-self::sect4                      |ancestor-or-self::sect5                      |ancestor-or-self::refentry                      |ancestor-or-self::refsect1                      |ancestor-or-self::refsect2                      |ancestor-or-self::refsect3                      |ancestor-or-self::simplesect                      |ancestor-or-self::bibliography                      |ancestor-or-self::glossary                      |ancestor-or-self::index)[last()])))[1])]">
  84.       <xsl:apply-templates select="." mode="reference"/>
  85.     </xsl:for-each>
  86.  
  87.     <xsl:if test="$refs[not(secondary)]/*[self::see]">
  88.       <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), " ", " ", " ", see))[1])]" mode="index-see">
  89.         <xsl:sort select="see"/>
  90.       </xsl:apply-templates>
  91.     </xsl:if>
  92.   </dt>
  93.   <xsl:if test="$refs/secondary or $refs[not(secondary)]/*[self::seealso]">
  94.     <dd xmlns="http://www.w3.org/1999/xhtml">
  95.       <dl>
  96.         <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), " ", " ", " ", seealso))[1])]" mode="index-seealso">
  97.           <xsl:sort select="seealso"/>
  98.         </xsl:apply-templates>
  99.         <xsl:apply-templates select="$refs[secondary and count(.|key('secondary', concat($key, " ", normalize-space(concat(secondary/@sortas, secondary[not(@sortas)]))))[1]) = 1]" mode="index-secondary">
  100.           <xsl:sort select="normalize-space(concat(secondary/@sortas, secondary[not(@sortas)]))"/>
  101.         </xsl:apply-templates>
  102.       </dl>
  103.     </dd>
  104.   </xsl:if>
  105. </xsl:template>
  106.  
  107. <xsl:template match="indexterm" mode="index-secondary">
  108.   <xsl:variable name="key" select="concat(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), " ", normalize-space(concat(secondary/@sortas, secondary[not(@sortas)])))"/>
  109.   <xsl:variable name="refs" select="key('secondary', $key)"/>
  110.   <dt xmlns="http://www.w3.org/1999/xhtml">
  111.     <xsl:value-of select="secondary"/>
  112.     <xsl:for-each select="$refs[generate-id() = generate-id(key('secondary-section', concat($key, " ", generate-id((ancestor-or-self::set                      |ancestor-or-self::book                      |ancestor-or-self::part                      |ancestor-or-self::reference                      |ancestor-or-self::partintro                      |ancestor-or-self::chapter                      |ancestor-or-self::appendix                      |ancestor-or-self::preface                      |ancestor-or-self::section                      |ancestor-or-self::sect1                      |ancestor-or-self::sect2                      |ancestor-or-self::sect3                      |ancestor-or-self::sect4                      |ancestor-or-self::sect5                      |ancestor-or-self::refentry                      |ancestor-or-self::refsect1                      |ancestor-or-self::refsect2                      |ancestor-or-self::refsect3                      |ancestor-or-self::simplesect                      |ancestor-or-self::bibliography                      |ancestor-or-self::glossary                      |ancestor-or-self::index)[last()])))[1])]">
  113.       <xsl:apply-templates select="." mode="reference"/>
  114.     </xsl:for-each>
  115.  
  116.     <xsl:if test="$refs[not(tertiary)]/*[self::see]">
  117.       <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), " ", normalize-space(concat(secondary/@sortas, secondary[not(@sortas)])), " ", " ", see))[1])]" mode="index-see">
  118.         <xsl:sort select="see"/>
  119.       </xsl:apply-templates>
  120.     </xsl:if>
  121.   </dt>
  122.   <xsl:if test="$refs/tertiary or $refs[not(tertiary)]/*[self::seealso]">
  123.     <dd xmlns="http://www.w3.org/1999/xhtml">
  124.       <dl>
  125.         <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), " ", normalize-space(concat(secondary/@sortas, secondary[not(@sortas)])), " ", " ", seealso))[1])]" mode="index-seealso">
  126.           <xsl:sort select="seealso"/>
  127.         </xsl:apply-templates>
  128.         <xsl:apply-templates select="$refs[tertiary and count(.|key('tertiary', concat($key, " ", normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas)]))))[1]) = 1]" mode="index-tertiary">
  129.           <xsl:sort select="normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas)]))"/>
  130.         </xsl:apply-templates>
  131.       </dl>
  132.     </dd>
  133.   </xsl:if>
  134. </xsl:template>
  135.  
  136. <xsl:template match="indexterm" mode="index-tertiary">
  137.   <xsl:variable name="key" select="concat(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), " ", normalize-space(concat(secondary/@sortas, secondary[not(@sortas)])), " ", normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas)])))"/>
  138.   <xsl:variable name="refs" select="key('tertiary', $key)"/>
  139.   <dt xmlns="http://www.w3.org/1999/xhtml">
  140.     <xsl:value-of select="tertiary"/>
  141.     <xsl:for-each select="$refs[generate-id() = generate-id(key('tertiary-section', concat($key, " ", generate-id((ancestor-or-self::set                      |ancestor-or-self::book                      |ancestor-or-self::part                      |ancestor-or-self::reference                      |ancestor-or-self::partintro                      |ancestor-or-self::chapter                      |ancestor-or-self::appendix                      |ancestor-or-self::preface                      |ancestor-or-self::section                      |ancestor-or-self::sect1                      |ancestor-or-self::sect2                      |ancestor-or-self::sect3                      |ancestor-or-self::sect4                      |ancestor-or-self::sect5                      |ancestor-or-self::refentry                      |ancestor-or-self::refsect1                      |ancestor-or-self::refsect2                      |ancestor-or-self::refsect3                      |ancestor-or-self::simplesect                      |ancestor-or-self::bibliography                      |ancestor-or-self::glossary                      |ancestor-or-self::index)[last()])))[1])]">
  142.       <xsl:apply-templates select="." mode="reference"/>
  143.     </xsl:for-each>
  144.  
  145.     <xsl:if test="$refs/see">
  146.       <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), " ", normalize-space(concat(secondary/@sortas, secondary[not(@sortas)])), " ", normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas)])), " ", see))[1])]" mode="index-see">
  147.         <xsl:sort select="see"/>
  148.       </xsl:apply-templates>
  149.     </xsl:if>
  150.   </dt>
  151.   <xsl:if test="$refs/seealso">
  152.     <dd xmlns="http://www.w3.org/1999/xhtml">
  153.       <dl>
  154.         <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), " ", normalize-space(concat(secondary/@sortas, secondary[not(@sortas)])), " ", normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas)])), " ", see))[1])]" mode="index-see">
  155.           <xsl:sort select="see"/>
  156.         </xsl:apply-templates>
  157.         <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(normalize-space(concat(primary/@sortas, primary[not(@sortas)])), " ", normalize-space(concat(secondary/@sortas, secondary[not(@sortas)])), " ", normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas)])), " ", seealso))[1])]" mode="index-seealso">
  158.           <xsl:sort select="seealso"/>
  159.         </xsl:apply-templates>
  160.       </dl>
  161.     </dd>
  162.   </xsl:if>
  163. </xsl:template>
  164.  
  165. <xsl:template match="indexterm" mode="reference">
  166.   <xsl:text>, </xsl:text>
  167.   <xsl:choose>
  168.     <xsl:when test="@zone and string(@zone)">
  169.       <xsl:call-template name="reference">
  170.         <xsl:with-param name="zones" select="normalize-space(@zone)"/>
  171.       </xsl:call-template>
  172.     </xsl:when>
  173.     <xsl:otherwise>
  174.       <a xmlns="http://www.w3.org/1999/xhtml">
  175.         <xsl:variable name="title">
  176.           <xsl:apply-templates select="(ancestor-or-self::set                      |ancestor-or-self::book                      |ancestor-or-self::part                      |ancestor-or-self::reference                      |ancestor-or-self::partintro                      |ancestor-or-self::chapter                      |ancestor-or-self::appendix                      |ancestor-or-self::preface                      |ancestor-or-self::section                      |ancestor-or-self::sect1                      |ancestor-or-self::sect2                      |ancestor-or-self::sect3                      |ancestor-or-self::sect4                      |ancestor-or-self::sect5                      |ancestor-or-self::refentry                      |ancestor-or-self::refsect1                      |ancestor-or-self::refsect2                      |ancestor-or-self::refsect3                      |ancestor-or-self::simplesect                      |ancestor-or-self::bibliography                      |ancestor-or-self::glossary                      |ancestor-or-self::index)[last()]" mode="title.markup"/>
  177.         </xsl:variable>
  178.  
  179.         <xsl:attribute name="href">
  180.           <xsl:call-template name="href.target">
  181.             <xsl:with-param name="object" select="(ancestor-or-self::set                      |ancestor-or-self::book                      |ancestor-or-self::part                      |ancestor-or-self::reference                      |ancestor-or-self::partintro                      |ancestor-or-self::chapter                      |ancestor-or-self::appendix                      |ancestor-or-self::preface                      |ancestor-or-self::section                      |ancestor-or-self::sect1                      |ancestor-or-self::sect2                      |ancestor-or-self::sect3                      |ancestor-or-self::sect4                      |ancestor-or-self::sect5                      |ancestor-or-self::refentry                      |ancestor-or-self::refsect1                      |ancestor-or-self::refsect2                      |ancestor-or-self::refsect3                      |ancestor-or-self::simplesect                      |ancestor-or-self::bibliography                      |ancestor-or-self::glossary                      |ancestor-or-self::index)[last()]"/>
  182.           </xsl:call-template>
  183.         </xsl:attribute>
  184.  
  185.         <xsl:value-of select="$title"/> <!-- text only -->
  186.       </a>
  187.     </xsl:otherwise>
  188.   </xsl:choose>
  189. </xsl:template>
  190.  
  191. <xsl:template name="reference">
  192.   <xsl:param name="zones"/>
  193.   <xsl:choose>
  194.     <xsl:when test="contains($zones, ' ')">
  195.       <xsl:variable name="zone" select="substring-before($zones, ' ')"/>
  196.       <xsl:variable name="target" select="key('sections', $zone)"/>
  197.  
  198.       <a xmlns="http://www.w3.org/1999/xhtml">
  199.         <xsl:attribute name="href">
  200.           <xsl:call-template name="href.target">
  201.             <xsl:with-param name="object" select="$target[1]"/>
  202.           </xsl:call-template>
  203.         </xsl:attribute>
  204.         <xsl:apply-templates select="$target[1]" mode="index-title-content"/>
  205.       </a>
  206.       <xsl:text>, </xsl:text>
  207.       <xsl:call-template name="reference">
  208.         <xsl:with-param name="zones" select="substring-after($zones, ' ')"/>
  209.       </xsl:call-template>
  210.     </xsl:when>
  211.     <xsl:otherwise>
  212.       <xsl:variable name="zone" select="$zones"/>
  213.       <xsl:variable name="target" select="key('sections', $zone)"/>
  214.  
  215.       <a xmlns="http://www.w3.org/1999/xhtml">
  216.         <xsl:attribute name="href">
  217.           <xsl:call-template name="href.target">
  218.             <xsl:with-param name="object" select="$target[1]"/>
  219.           </xsl:call-template>
  220.         </xsl:attribute>
  221.         <xsl:apply-templates select="$target[1]" mode="index-title-content"/>
  222.       </a>
  223.     </xsl:otherwise>
  224.   </xsl:choose>
  225. </xsl:template>
  226.  
  227. <xsl:template match="indexterm" mode="index-see">
  228.   <xsl:text> (</xsl:text>
  229.   <xsl:call-template name="gentext">
  230.     <xsl:with-param name="key" select="'see'"/>
  231.   </xsl:call-template>
  232.   <xsl:text> </xsl:text>
  233.   <xsl:value-of select="see"/>
  234.   <xsl:text>)</xsl:text>
  235. </xsl:template>
  236.  
  237. <xsl:template match="indexterm" mode="index-seealso">
  238.   <xsl:text>(</xsl:text>
  239.   <xsl:call-template name="gentext">
  240.     <xsl:with-param name="key" select="'seealso'"/>
  241.   </xsl:call-template>
  242.   <xsl:text> </xsl:text>
  243.   <xsl:value-of select="seealso"/>
  244.   <xsl:text>)</xsl:text>
  245. </xsl:template>
  246.  
  247. <xsl:template match="*" mode="index-title-content">
  248.   <xsl:variable name="title">
  249.     <xsl:apply-templates select="(ancestor-or-self::set                      |ancestor-or-self::book                      |ancestor-or-self::part                      |ancestor-or-self::reference                      |ancestor-or-self::partintro                      |ancestor-or-self::chapter                      |ancestor-or-self::appendix                      |ancestor-or-self::preface                      |ancestor-or-self::section                      |ancestor-or-self::sect1                      |ancestor-or-self::sect2                      |ancestor-or-self::sect3                      |ancestor-or-self::sect4                      |ancestor-or-self::sect5                      |ancestor-or-self::refentry                      |ancestor-or-self::refsect1                      |ancestor-or-self::refsect2                      |ancestor-or-self::refsect3                      |ancestor-or-self::simplesect                      |ancestor-or-self::bibliography                      |ancestor-or-self::glossary                      |ancestor-or-self::index)[last()]" mode="title.markup"/>
  250.   </xsl:variable>
  251.  
  252.   <xsl:value-of select="$title"/>
  253. </xsl:template>
  254.  
  255. </xsl:stylesheet>
  256.