home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / building / xmlspy / xmlspyentcomplete5.exe / Data1.cab / _888C75E37A4849049BD10D89AA7ACE62 < prev    next >
Encoding:
Extensible Markup Language  |  2002-09-04  |  33.3 KB  |  870 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. <xsl:template name="chunk">
  7.   <xsl:param name="node" select="."/>
  8.   <!-- returns 1 if $node is a chunk -->
  9.  
  10.   <!-- ==================================================================== -->
  11.   <!-- What's a chunk?
  12.  
  13.        The root element
  14.        appendix
  15.        article
  16.        bibliography  in article or book
  17.        book
  18.        chapter
  19.        colophon
  20.        glossary      in article or book
  21.        index         in article or book
  22.        part
  23.        preface
  24.        refentry
  25.        reference
  26.        sect{1,2,3,4,5}  if position()>1 && depth < chunk.section.depth
  27.        section          if position()>1 && depth < chunk.section.depth
  28.        set
  29.        setindex
  30.                                                                             -->
  31.   <!-- ==================================================================== -->
  32.  
  33. <!--
  34.   <xsl:message>
  35.     <xsl:text>chunk: </xsl:text>
  36.     <xsl:value-of select="name($node)"/>
  37.     <xsl:text>(</xsl:text>
  38.     <xsl:value-of select="$node/@id"/>
  39.     <xsl:text>)</xsl:text>
  40.     <xsl:text> csd: </xsl:text>
  41.     <xsl:value-of select="$chunk.section.depth"/>
  42.     <xsl:text> cfs: </xsl:text>
  43.     <xsl:value-of select="$chunk.first.sections"/>
  44.     <xsl:text> ps: </xsl:text>
  45.     <xsl:value-of select="count($node/parent::section)"/>
  46.     <xsl:text> prs: </xsl:text>
  47.     <xsl:value-of select="count($node/preceding-sibling::section)"/>
  48.   </xsl:message>
  49. -->
  50.  
  51.   <xsl:choose>
  52.     <xsl:when test="not($node/parent::*)">1</xsl:when>
  53.  
  54.     <xsl:when test="local-name($node) = 'sect1'                     and $chunk.section.depth >= 1                     and ($chunk.first.sections != 0                          or count($node/preceding-sibling::sect1) > 0)">
  55.       <xsl:text>1</xsl:text>
  56.     </xsl:when>
  57.     <xsl:when test="local-name($node) = 'sect2'                     and $chunk.section.depth >= 2                     and ($chunk.first.sections != 0                          or count($node/preceding-sibling::sect2) > 0)">
  58.       <xsl:call-template name="chunk">
  59.         <xsl:with-param name="node" select="$node/parent::*"/>
  60.       </xsl:call-template>
  61.     </xsl:when>
  62.     <xsl:when test="local-name($node) = 'sect3'                     and $chunk.section.depth >= 3                     and ($chunk.first.sections != 0                          or count($node/preceding-sibling::sect3) > 0)">
  63.       <xsl:call-template name="chunk">
  64.         <xsl:with-param name="node" select="$node/parent::*"/>
  65.       </xsl:call-template>
  66.     </xsl:when>
  67.     <xsl:when test="local-name($node) = 'sect4'                     and $chunk.section.depth >= 4                     and ($chunk.first.sections != 0                          or count($node/preceding-sibling::sect4) > 0)">
  68.       <xsl:call-template name="chunk">
  69.         <xsl:with-param name="node" select="$node/parent::*"/>
  70.       </xsl:call-template>
  71.     </xsl:when>
  72.     <xsl:when test="local-name($node) = 'sect5'                     and $chunk.section.depth >= 5                     and ($chunk.first.sections != 0                          or count($node/preceding-sibling::sect5) > 0)">
  73.       <xsl:call-template name="chunk">
  74.         <xsl:with-param name="node" select="$node/parent::*"/>
  75.       </xsl:call-template>
  76.     </xsl:when>
  77.     <xsl:when test="local-name($node) = 'section'                     and $chunk.section.depth >= count($node/ancestor::section)+1                     and ($chunk.first.sections != 0                          or count($node/preceding-sibling::section) > 0)">
  78.       <xsl:call-template name="chunk">
  79.         <xsl:with-param name="node" select="$node/parent::*"/>
  80.       </xsl:call-template>
  81.     </xsl:when>
  82.  
  83.     <xsl:when test="name($node)='preface'">1</xsl:when>
  84.     <xsl:when test="name($node)='chapter'">1</xsl:when>
  85.     <xsl:when test="name($node)='appendix'">1</xsl:when>
  86.     <xsl:when test="name($node)='article'">1</xsl:when>
  87.     <xsl:when test="name($node)='part'">1</xsl:when>
  88.     <xsl:when test="name($node)='reference'">1</xsl:when>
  89.     <xsl:when test="name($node)='refentry'">1</xsl:when>
  90.     <xsl:when test="name($node)='index'                     and (name($node/parent::*) = 'article'                          or name($node/parent::*) = 'book')">1</xsl:when>
  91.     <xsl:when test="name($node)='bibliography'                     and (name($node/parent::*) = 'article'                          or name($node/parent::*) = 'book')">1</xsl:when>
  92.     <xsl:when test="name($node)='glossary'                     and (name($node/parent::*) = 'article'                          or name($node/parent::*) = 'book')">1</xsl:when>
  93.     <xsl:when test="name($node)='colophon'">1</xsl:when>
  94.     <xsl:when test="name($node)='book'">1</xsl:when>
  95.     <xsl:when test="name($node)='set'">1</xsl:when>
  96.     <xsl:when test="name($node)='setindex'">1</xsl:when>
  97.     <xsl:otherwise>0</xsl:otherwise>
  98.   </xsl:choose>
  99. </xsl:template>
  100.  
  101. <!-- ==================================================================== -->
  102.  
  103. <xsl:template match="*" mode="chunk-filename">
  104.   <xsl:variable name="fn">
  105.     <xsl:apply-templates select="." mode="recursive-chunk-filename"/>
  106.   </xsl:variable>
  107.  
  108.   <xsl:if test="$fn != ''">
  109.     <xsl:call-template name="dbhtml-dir"/>
  110.   </xsl:if>
  111.  
  112.   <xsl:value-of select="$fn"/>
  113.   <xsl:value-of select="$html.ext"/>
  114. </xsl:template>
  115.  
  116. <xsl:template match="*" mode="recursive-chunk-filename">
  117.   <xsl:param name="recursive" select="false()"/>
  118.  
  119.   <!-- returns the filename of a chunk -->
  120.   <xsl:variable name="ischunk">
  121.     <xsl:call-template name="chunk"/>
  122.   </xsl:variable>
  123.  
  124.   <xsl:variable name="dbhtml-filename">
  125.     <xsl:call-template name="dbhtml-filename"/>
  126.   </xsl:variable>
  127.  
  128.   <xsl:variable name="filename">
  129.     <xsl:choose>
  130.       <xsl:when test="$dbhtml-filename != ''">
  131.         <xsl:value-of select="$dbhtml-filename"/>
  132.       </xsl:when>
  133.       <!-- if this is the root element, use the root.filename -->
  134.       <xsl:when test="not(parent::*) and $root.filename != ''">
  135.         <xsl:value-of select="$root.filename"/>
  136.       </xsl:when>
  137.       <!-- if there's no dbhtml filename, and if we're to use IDs as -->
  138.       <!-- filenames, then use the ID to generate the filename. -->
  139.       <xsl:when test="@id and $use.id.as.filename != 0">
  140.         <xsl:value-of select="@id"/>
  141.       </xsl:when>
  142.       <xsl:otherwise/>
  143.     </xsl:choose>
  144.   </xsl:variable>
  145.  
  146.   <xsl:choose>
  147.     <xsl:when test="$ischunk='0'">
  148.       <!-- if called on something that isn't a chunk, walk up... -->
  149.       <xsl:choose>
  150.         <xsl:when test="count(parent::*)>0">
  151.           <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  152.             <xsl:with-param name="recursive" select="$recursive"/>
  153.           </xsl:apply-templates>
  154.         </xsl:when>
  155.         <!-- unless there is no up, in which case return "" -->
  156.         <xsl:otherwise/>
  157.       </xsl:choose>
  158.     </xsl:when>
  159.  
  160.     <xsl:when test="not($recursive) and $filename != ''">
  161.       <!-- if this chunk has an explicit name, use it -->
  162.       <xsl:value-of select="$filename"/>
  163.     </xsl:when>
  164.  
  165.     <xsl:when test="name(.)='set'">
  166.       <xsl:value-of select="$root.filename"/>
  167.     </xsl:when>
  168.  
  169.     <xsl:when test="name(.)='book'">
  170.       <xsl:text>bk</xsl:text>
  171.       <xsl:number level="any" format="01"/>
  172.     </xsl:when>
  173.  
  174.     <xsl:when test="name(.)='article'">
  175.       <xsl:if test="/set">
  176.         <!-- in a set, make sure we inherit the right book info... -->
  177.         <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  178.           <xsl:with-param name="recursive" select="true()"/>
  179.         </xsl:apply-templates>
  180.       </xsl:if>
  181.  
  182.       <xsl:text>ar</xsl:text>
  183.       <xsl:number level="any" format="01" from="book"/>
  184.     </xsl:when>
  185.  
  186.     <xsl:when test="name(.)='preface'">
  187.       <xsl:if test="/set">
  188.         <!-- in a set, make sure we inherit the right book info... -->
  189.         <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  190.           <xsl:with-param name="recursive" select="true()"/>
  191.         </xsl:apply-templates>
  192.       </xsl:if>
  193.  
  194.       <xsl:text>pr</xsl:text>
  195.       <xsl:number level="any" format="01" from="book"/>
  196.     </xsl:when>
  197.  
  198.     <xsl:when test="name(.)='chapter'">
  199.       <xsl:if test="/set">
  200.         <!-- in a set, make sure we inherit the right book info... -->
  201.         <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  202.           <xsl:with-param name="recursive" select="true()"/>
  203.         </xsl:apply-templates>
  204.       </xsl:if>
  205.  
  206.       <xsl:text>ch</xsl:text>
  207.       <xsl:number level="any" format="01" from="book"/>
  208.     </xsl:when>
  209.  
  210.     <xsl:when test="name(.)='appendix'">
  211.       <xsl:if test="/set">
  212.         <!-- in a set, make sure we inherit the right book info... -->
  213.         <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  214.           <xsl:with-param name="recursive" select="true()"/>
  215.         </xsl:apply-templates>
  216.       </xsl:if>
  217.  
  218.       <xsl:text>ap</xsl:text>
  219.       <xsl:number level="any" format="a" from="book"/>
  220.     </xsl:when>
  221.  
  222.     <xsl:when test="name(.)='part'">
  223.       <xsl:choose>
  224.         <xsl:when test="/set">
  225.           <!-- in a set, make sure we inherit the right book info... -->
  226.           <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  227.             <xsl:with-param name="recursive" select="true()"/>
  228.           </xsl:apply-templates>
  229.         </xsl:when>
  230.         <xsl:otherwise>
  231.         </xsl:otherwise>
  232.       </xsl:choose>
  233.  
  234.       <xsl:text>pt</xsl:text>
  235.       <xsl:number level="any" format="01" from="book"/>
  236.     </xsl:when>
  237.  
  238.     <xsl:when test="name(.)='reference'">
  239.       <xsl:choose>
  240.         <xsl:when test="/set">
  241.           <!-- in a set, make sure we inherit the right book info... -->
  242.           <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  243.             <xsl:with-param name="recursive" select="true()"/>
  244.           </xsl:apply-templates>
  245.         </xsl:when>
  246.         <xsl:otherwise>
  247.         </xsl:otherwise>
  248.       </xsl:choose>
  249.  
  250.       <xsl:text>rn</xsl:text>
  251.       <xsl:number level="any" format="01" from="book"/>
  252.     </xsl:when>
  253.  
  254.     <xsl:when test="name(.)='refentry'">
  255.       <xsl:choose>
  256.         <xsl:when test="parent::reference">
  257.           <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  258.             <xsl:with-param name="recursive" select="true()"/>
  259.           </xsl:apply-templates>
  260.         </xsl:when>
  261.         <xsl:otherwise>
  262.         </xsl:otherwise>
  263.       </xsl:choose>
  264.  
  265.       <xsl:text>re</xsl:text>
  266.       <xsl:number level="any" format="01" from="book"/>
  267.     </xsl:when>
  268.  
  269.     <xsl:when test="name(.)='colophon'">
  270.       <xsl:choose>
  271.         <xsl:when test="/set">
  272.           <!-- in a set, make sure we inherit the right book info... -->
  273.           <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  274.             <xsl:with-param name="recursive" select="true()"/>
  275.           </xsl:apply-templates>
  276.         </xsl:when>
  277.         <xsl:otherwise>
  278.         </xsl:otherwise>
  279.       </xsl:choose>
  280.  
  281.       <xsl:text>co</xsl:text>
  282.       <xsl:number level="any" format="01" from="book"/>
  283.     </xsl:when>
  284.  
  285.     <xsl:when test="local-name(.) = 'sect1'                     or local-name(.) = 'sect2'                     or local-name(.) = 'sect3'                     or local-name(.) = 'sect4'                     or local-name(.) = 'sect5'                     or local-name(.) = 'section'">
  286.       <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  287.         <xsl:with-param name="recursive" select="true()"/>
  288.       </xsl:apply-templates>
  289.       <xsl:text>s</xsl:text>
  290.       <xsl:number format="01"/>
  291.     </xsl:when>
  292.  
  293.     <xsl:when test="name(.)='sect1' or name(.)='section'">
  294.       <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  295.         <xsl:with-param name="recursive" select="true()"/>
  296.       </xsl:apply-templates>
  297.       <xsl:text>s</xsl:text>
  298.       <xsl:number level="any" format="01" from="preface|chapter|appendix"/>
  299.     </xsl:when>
  300.  
  301.     <xsl:when test="name(.)='bibliography'">
  302.       <xsl:choose>
  303.         <xsl:when test="/set">
  304.           <!-- in a set, make sure we inherit the right book info... -->
  305.           <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  306.             <xsl:with-param name="recursive" select="true()"/>
  307.           </xsl:apply-templates>
  308.         </xsl:when>
  309.         <xsl:otherwise>
  310.         </xsl:otherwise>
  311.       </xsl:choose>
  312.  
  313.       <xsl:text>bi</xsl:text>
  314.       <xsl:number level="any" format="01" from="book"/>
  315.     </xsl:when>
  316.  
  317.     <xsl:when test="name(.)='glossary'">
  318.       <xsl:choose>
  319.         <xsl:when test="/set">
  320.           <!-- in a set, make sure we inherit the right book info... -->
  321.           <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  322.             <xsl:with-param name="recursive" select="true()"/>
  323.           </xsl:apply-templates>
  324.         </xsl:when>
  325.         <xsl:otherwise>
  326.         </xsl:otherwise>
  327.       </xsl:choose>
  328.  
  329.       <xsl:text>go</xsl:text>
  330.       <xsl:number level="any" format="01" from="book"/>
  331.     </xsl:when>
  332.  
  333.     <xsl:when test="name(.)='index'">
  334.       <xsl:choose>
  335.         <xsl:when test="/set">
  336.           <!-- in a set, make sure we inherit the right book info... -->
  337.           <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  338.             <xsl:with-param name="recursive" select="true()"/>
  339.           </xsl:apply-templates>
  340.         </xsl:when>
  341.         <xsl:otherwise>
  342.         </xsl:otherwise>
  343.       </xsl:choose>
  344.  
  345.       <xsl:text>ix</xsl:text>
  346.       <xsl:number level="any" format="01" from="book"/>
  347.     </xsl:when>
  348.  
  349.     <xsl:when test="name(.)='setindex'">
  350.       <xsl:text>si</xsl:text>
  351.       <xsl:number level="any" format="01" from="set"/>
  352.     </xsl:when>
  353.  
  354.     <xsl:otherwise>
  355.       <xsl:text>chunk-filename-error-</xsl:text>
  356.       <xsl:value-of select="name(.)"/>
  357.       <xsl:number level="any" format="01" from="set"/>
  358.     </xsl:otherwise>
  359.   </xsl:choose>
  360. </xsl:template>
  361.  
  362. <!-- ==================================================================== -->
  363.  
  364. <xsl:template name="href.target.uri">
  365.   <xsl:param name="object" select="."/>
  366.   <xsl:variable name="ischunk">
  367.     <xsl:call-template name="chunk">
  368.       <xsl:with-param name="node" select="$object"/>
  369.     </xsl:call-template>
  370.   </xsl:variable>
  371.  
  372.   <xsl:apply-templates mode="chunk-filename" select="$object"/>
  373.  
  374.   <xsl:if test="$ischunk='0'">
  375.     <xsl:text>#</xsl:text>
  376.     <xsl:call-template name="object.id">
  377.       <xsl:with-param name="object" select="$object"/>
  378.     </xsl:call-template>
  379.   </xsl:if>
  380. </xsl:template>
  381.  
  382. <xsl:template name="href.target">
  383.   <xsl:param name="context" select="."/>
  384.   <xsl:param name="object" select="."/>
  385.  
  386.   <xsl:variable name="href.to.uri">
  387.     <xsl:call-template name="href.target.uri">
  388.       <xsl:with-param name="object" select="$object"/>
  389.     </xsl:call-template>
  390.   </xsl:variable>
  391.  
  392.   <xsl:variable name="href.from.uri">
  393.     <xsl:call-template name="href.target.uri">
  394.       <xsl:with-param name="object" select="$context"/>
  395.     </xsl:call-template>
  396.   </xsl:variable>
  397.  
  398.   <xsl:variable name="href.to">
  399.     <xsl:call-template name="trim.common.uri.paths">
  400.       <xsl:with-param name="uriA" select="$href.to.uri"/>
  401.       <xsl:with-param name="uriB" select="$href.from.uri"/>
  402.       <xsl:with-param name="return" select="'A'"/>
  403.     </xsl:call-template>
  404.   </xsl:variable>
  405.  
  406.   <xsl:variable name="href.from">
  407.     <xsl:call-template name="trim.common.uri.paths">
  408.       <xsl:with-param name="uriA" select="$href.to.uri"/>
  409.       <xsl:with-param name="uriB" select="$href.from.uri"/>
  410.       <xsl:with-param name="return" select="'B'"/>
  411.     </xsl:call-template>
  412.   </xsl:variable>
  413.  
  414.   <xsl:variable name="depth">
  415.     <xsl:call-template name="count.uri.path.depth">
  416.       <xsl:with-param name="filename" select="$href.from"/>
  417.     </xsl:call-template>
  418.   </xsl:variable>
  419.  
  420.   <xsl:variable name="href">
  421.     <xsl:call-template name="copy-string">
  422.       <xsl:with-param name="string" select="'../'"/>
  423.       <xsl:with-param name="count" select="$depth"/>
  424.     </xsl:call-template>
  425.     <xsl:value-of select="$href.to"/>
  426.   </xsl:variable>
  427.  
  428. <!--
  429.   <xsl:message>
  430.     <xsl:text>In </xsl:text>
  431.     <xsl:value-of select="name(.)"/>
  432.     <xsl:text> (</xsl:text>
  433.     <xsl:value-of select="$href.from"/>
  434.     <xsl:text>,</xsl:text>
  435.     <xsl:value-of select="$depth"/>
  436.     <xsl:text>) </xsl:text>
  437.     <xsl:value-of select="name($object)"/>
  438.     <xsl:text> href=</xsl:text>
  439.     <xsl:value-of select="$href"/>
  440.   </xsl:message>
  441. -->
  442.  
  443.   <xsl:value-of select="$href"/>
  444. </xsl:template>
  445.  
  446. <!-- ==================================================================== -->
  447.  
  448. <xsl:template name="html.head">
  449.   <xsl:param name="prev" select="/foo"/>
  450.   <xsl:param name="next" select="/foo"/>
  451.   <xsl:variable name="this" select="."/>
  452.   <xsl:variable name="home" select="/*[1]"/>
  453.   <xsl:variable name="up" select="parent::*"/>
  454.  
  455.   <head xmlns="http://www.w3.org/1999/xhtml">
  456.     <xsl:call-template name="head.content"/>
  457.     <xsl:call-template name="user.head.content"/>
  458.  
  459.     <xsl:if test="$home">
  460.       <link rel="home">
  461.         <xsl:attribute name="href">
  462.           <xsl:call-template name="href.target">
  463.             <xsl:with-param name="object" select="$home"/>
  464.           </xsl:call-template>
  465.         </xsl:attribute>
  466.         <xsl:attribute name="title">
  467.           <xsl:apply-templates select="$home" mode="object.title.markup.textonly"/>
  468.         </xsl:attribute>
  469.       </link>
  470.     </xsl:if>
  471.  
  472.     <xsl:if test="$up">
  473.       <link rel="up">
  474.         <xsl:attribute name="href">
  475.           <xsl:call-template name="href.target">
  476.             <xsl:with-param name="object" select="$up"/>
  477.           </xsl:call-template>
  478.         </xsl:attribute>
  479.         <xsl:attribute name="title">
  480.           <xsl:apply-templates select="$up" mode="object.title.markup.textonly"/>
  481.         </xsl:attribute>
  482.       </link>
  483.     </xsl:if>
  484.  
  485.     <xsl:if test="$prev">
  486.       <link rel="previous">
  487.         <xsl:attribute name="href">
  488.           <xsl:call-template name="href.target">
  489.             <xsl:with-param name="object" select="$prev"/>
  490.           </xsl:call-template>
  491.         </xsl:attribute>
  492.         <xsl:attribute name="title">
  493.           <xsl:apply-templates select="$prev" mode="object.title.markup.textonly"/>
  494.         </xsl:attribute>
  495.       </link>
  496.     </xsl:if>
  497.  
  498.     <xsl:if test="$next">
  499.       <link rel="next">
  500.         <xsl:attribute name="href">
  501.           <xsl:call-template name="href.target">
  502.             <xsl:with-param name="object" select="$next"/>
  503.           </xsl:call-template>
  504.         </xsl:attribute>
  505.         <xsl:attribute name="title">
  506.           <xsl:apply-templates select="$next" mode="object.title.markup.textonly"/>
  507.         </xsl:attribute>
  508.       </link>
  509.     </xsl:if>
  510.  
  511.     <xsl:if test="$html.extra.head.links != 0">
  512.       <xsl:for-each select="//part                             |//reference                             |//preface                             |//chapter                             |//article                             |//refentry                             |//appendix[not(parent::article)]|appendix                             |//glossary[not(parent::article)]|glossary                             |//index[not(parent::article)]|index">
  513.         <link rel="{local-name(.)}">
  514.           <xsl:attribute name="href">
  515.             <xsl:call-template name="href.target">
  516.               <xsl:with-param name="context" select="$this"/>
  517.               <xsl:with-param name="object" select="."/>
  518.             </xsl:call-template>
  519.           </xsl:attribute>
  520.           <xsl:attribute name="title">
  521.             <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
  522.           </xsl:attribute>
  523.         </link>
  524.       </xsl:for-each>
  525.  
  526.       <xsl:for-each select="section|sect1|refsection|refsect1">
  527.         <link>
  528.           <xsl:attribute name="rel">
  529.             <xsl:choose>
  530.               <xsl:when test="local-name($this) = 'section'                               or local-name($this) = 'refsection'">
  531.                 <xsl:value-of select="'subsection'"/>
  532.               </xsl:when>
  533.               <xsl:otherwise>
  534.                 <xsl:value-of select="'section'"/>
  535.               </xsl:otherwise>
  536.             </xsl:choose>
  537.           </xsl:attribute>
  538.           <xsl:attribute name="href">
  539.             <xsl:call-template name="href.target">
  540.               <xsl:with-param name="context" select="$this"/>
  541.               <xsl:with-param name="object" select="."/>
  542.             </xsl:call-template>
  543.           </xsl:attribute>
  544.           <xsl:attribute name="title">
  545.             <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
  546.           </xsl:attribute>
  547.         </link>
  548.       </xsl:for-each>
  549.  
  550.       <xsl:for-each select="sect2|sect3|sect4|sect5|refsect2|refsect3">
  551.         <link rel="subsection">
  552.           <xsl:attribute name="href">
  553.             <xsl:call-template name="href.target">
  554.               <xsl:with-param name="context" select="$this"/>
  555.               <xsl:with-param name="object" select="."/>
  556.             </xsl:call-template>
  557.           </xsl:attribute>
  558.           <xsl:attribute name="title">
  559.             <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
  560.           </xsl:attribute>
  561.         </link>
  562.       </xsl:for-each>
  563.     </xsl:if>
  564.   </head>
  565. </xsl:template>
  566.  
  567. <!-- ==================================================================== -->
  568.  
  569. <xsl:template name="header.navigation">
  570.   <xsl:param name="prev" select="/foo"/>
  571.   <xsl:param name="next" select="/foo"/>
  572.   <xsl:param name="nav.context"/>
  573.  
  574.   <xsl:variable name="home" select="/*[1]"/>
  575.   <xsl:variable name="up" select="parent::*"/>
  576.  
  577.   <xsl:variable name="row1" select="$navig.showtitles != 0"/>
  578.   <xsl:variable name="row2" select="count($prev) > 0                                     or (count($up) > 0                                          and $up != $home                                         and $navig.showtitles != 0)                                     or count($next) > 0"/>
  579.  
  580.   <xsl:if test="$suppress.navigation = '0' and $suppress.header.navigation = '0'">
  581.     <div xmlns="http://www.w3.org/1999/xhtml" class="navheader">
  582.       <xsl:if test="$row1 or $row2">
  583.         <table width="100%" summary="Navigation header">
  584.           <xsl:if test="$row1">
  585.             <tr>
  586.               <th colspan="3" align="center">
  587.                 <xsl:apply-templates select="." mode="object.title.markup"/>
  588.               </th>
  589.             </tr>
  590.           </xsl:if>
  591.  
  592.           <xsl:if test="$row2">
  593.             <tr>
  594.               <td width="20%" align="left">
  595.                 <xsl:if test="count($prev)>0">
  596.                   <a accesskey="p">
  597.                     <xsl:attribute name="href">
  598.                       <xsl:call-template name="href.target">
  599.                         <xsl:with-param name="object" select="$prev"/>
  600.                       </xsl:call-template>
  601.                     </xsl:attribute>
  602.                     <xsl:call-template name="navig.content">
  603.                       <xsl:with-param name="direction" select="'prev'"/>
  604.                     </xsl:call-template>
  605.                   </a>
  606.                 </xsl:if>
  607.                 <xsl:text> </xsl:text>
  608.               </td>
  609.               <th width="60%" align="center">
  610.                 <xsl:choose>
  611.                   <xsl:when test="count($up) > 0                                   and $up != $home                                   and $navig.showtitles != 0">
  612.                     <xsl:apply-templates select="$up" mode="object.title.markup"/>
  613.                   </xsl:when>
  614.                   <xsl:otherwise> </xsl:otherwise>
  615.                 </xsl:choose>
  616.               </th>
  617.               <td width="20%" align="right">
  618.                 <xsl:text> </xsl:text>
  619.                 <xsl:if test="count($next)>0">
  620.                   <a accesskey="n">
  621.                     <xsl:attribute name="href">
  622.                       <xsl:call-template name="href.target">
  623.                         <xsl:with-param name="object" select="$next"/>
  624.                       </xsl:call-template>
  625.                     </xsl:attribute>
  626.                     <xsl:call-template name="navig.content">
  627.                       <xsl:with-param name="direction" select="'next'"/>
  628.                     </xsl:call-template>
  629.                   </a>
  630.                 </xsl:if>
  631.               </td>
  632.             </tr>
  633.           </xsl:if>
  634.         </table>
  635.       </xsl:if>
  636.       <xsl:if test="$header.rule != 0">
  637.         <hr/>
  638.       </xsl:if>
  639.     </div>
  640.   </xsl:if>
  641. </xsl:template>
  642.  
  643. <!-- ==================================================================== -->
  644.  
  645. <xsl:template name="footer.navigation">
  646.   <xsl:param name="prev" select="/foo"/>
  647.   <xsl:param name="next" select="/foo"/>
  648.   <xsl:param name="nav.context"/>
  649.  
  650.   <xsl:variable name="home" select="/*[1]"/>
  651.   <xsl:variable name="up" select="parent::*"/>
  652.  
  653.   <xsl:variable name="row1" select="count($prev) > 0                                     or count($up) > 0                                     or count($next) > 0"/>
  654.  
  655.   <xsl:variable name="row2" select="($prev and $navig.showtitles != 0)                                     or ($home != . or $nav.context = 'toc')                                     or ($chunk.tocs.and.lots != 0                                         and $nav.context != 'toc')                                     or ($next and $navig.showtitles != 0)"/>
  656.  
  657.   <xsl:if test="$suppress.navigation = '0' and $suppress.footer.navigation = '0'">
  658.     <div xmlns="http://www.w3.org/1999/xhtml" class="navfooter">
  659.       <xsl:if test="$footer.rule != 0">
  660.         <hr/>
  661.       </xsl:if>
  662.  
  663.       <xsl:if test="$row1 or $row2">
  664.         <table width="100%" summary="Navigation footer">
  665.           <xsl:if test="$row1">
  666.             <tr>
  667.               <td width="40%" align="left">
  668.                 <xsl:if test="count($prev)>0">
  669.                   <a accesskey="p">
  670.                     <xsl:attribute name="href">
  671.                       <xsl:call-template name="href.target">
  672.                         <xsl:with-param name="object" select="$prev"/>
  673.                       </xsl:call-template>
  674.                     </xsl:attribute>
  675.                     <xsl:call-template name="navig.content">
  676.                       <xsl:with-param name="direction" select="'prev'"/>
  677.                     </xsl:call-template>
  678.                   </a>
  679.                 </xsl:if>
  680.                 <xsl:text> </xsl:text>
  681.               </td>
  682.               <td width="20%" align="center">
  683.                 <xsl:choose>
  684.                   <xsl:when test="count($up)>0">
  685.                     <a accesskey="u">
  686.                       <xsl:attribute name="href">
  687.                         <xsl:call-template name="href.target">
  688.                           <xsl:with-param name="object" select="$up"/>
  689.                         </xsl:call-template>
  690.                       </xsl:attribute>
  691.                       <xsl:call-template name="navig.content">
  692.                         <xsl:with-param name="direction" select="'up'"/>
  693.                       </xsl:call-template>
  694.                     </a>
  695.                   </xsl:when>
  696.                   <xsl:otherwise> </xsl:otherwise>
  697.                 </xsl:choose>
  698.               </td>
  699.               <td width="40%" align="right">
  700.                 <xsl:text> </xsl:text>
  701.                 <xsl:if test="count($next)>0">
  702.                   <a accesskey="n">
  703.                     <xsl:attribute name="href">
  704.                       <xsl:call-template name="href.target">
  705.                         <xsl:with-param name="object" select="$next"/>
  706.                       </xsl:call-template>
  707.                     </xsl:attribute>
  708.                     <xsl:call-template name="navig.content">
  709.                       <xsl:with-param name="direction" select="'next'"/>
  710.                     </xsl:call-template>
  711.                   </a>
  712.                 </xsl:if>
  713.               </td>
  714.             </tr>
  715.           </xsl:if>
  716.  
  717.           <xsl:if test="$row2">
  718.             <tr>
  719.               <td width="40%" align="left" valign="top">
  720.                 <xsl:if test="$navig.showtitles != 0">
  721.                   <xsl:apply-templates select="$prev" mode="object.title.markup"/>
  722.                 </xsl:if>
  723.                 <xsl:text> </xsl:text>
  724.               </td>
  725.               <td width="20%" align="center">
  726.                 <xsl:choose>
  727.                   <xsl:when test="$home != . or $nav.context = 'toc'">
  728.                     <a accesskey="h">
  729.                       <xsl:attribute name="href">
  730.                         <xsl:call-template name="href.target">
  731.                           <xsl:with-param name="object" select="$home"/>
  732.                         </xsl:call-template>
  733.                       </xsl:attribute>
  734.                       <xsl:call-template name="navig.content">
  735.                         <xsl:with-param name="direction" select="'home'"/>
  736.                       </xsl:call-template>
  737.                     </a>
  738.                     <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
  739.                       <xsl:text> | </xsl:text>
  740.                     </xsl:if>
  741.                   </xsl:when>
  742.                   <xsl:otherwise> </xsl:otherwise>
  743.                 </xsl:choose>
  744.  
  745.                 <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
  746.                   <a accesskey="t">
  747.                     <xsl:attribute name="href">
  748.                       <xsl:apply-templates select="/*[1]" mode="recursive-chunk-filename"/>
  749.                       <xsl:text>-toc</xsl:text>
  750.                       <xsl:value-of select="$html.ext"/>
  751.                     </xsl:attribute>
  752.                     <xsl:call-template name="gentext">
  753.                       <xsl:with-param name="key" select="'nav-toc'"/>
  754.                     </xsl:call-template>
  755.                   </a>
  756.                 </xsl:if>
  757.               </td>
  758.               <td width="40%" align="right" valign="top">
  759.                 <xsl:text> </xsl:text>
  760.                 <xsl:if test="$navig.showtitles != 0">
  761.                   <xsl:apply-templates select="$next" mode="object.title.markup"/>
  762.                 </xsl:if>
  763.               </td>
  764.             </tr>
  765.           </xsl:if>
  766.         </table>
  767.       </xsl:if>
  768.     </div>
  769.   </xsl:if>
  770. </xsl:template>
  771.  
  772. <!-- ==================================================================== -->
  773.  
  774. <xsl:template name="navig.content">
  775.     <xsl:param name="direction" select="next"/>
  776.     <xsl:variable name="navtext">
  777.         <xsl:choose>
  778.         <xsl:when test="$direction = 'prev'">
  779.         <xsl:call-template name="gentext.nav.prev"/>
  780.         </xsl:when>
  781.         <xsl:when test="$direction = 'next'">
  782.         <xsl:call-template name="gentext.nav.next"/>
  783.         </xsl:when>
  784.         <xsl:when test="$direction = 'up'">
  785.         <xsl:call-template name="gentext.nav.up"/>
  786.         </xsl:when>
  787.         <xsl:when test="$direction = 'home'">
  788.         <xsl:call-template name="gentext.nav.home"/>
  789.         </xsl:when>
  790.         <xsl:otherwise>
  791.         <xsl:text>xxx</xsl:text>
  792.         </xsl:otherwise>
  793.     </xsl:choose>
  794.     </xsl:variable>
  795.  
  796.     <xsl:choose>
  797.     <xsl:when test="$navig.graphics != 0">
  798.         <img xmlns="http://www.w3.org/1999/xhtml">
  799.         <xsl:attribute name="src">
  800.             <xsl:value-of select="$navig.graphics.path"/>
  801.             <xsl:value-of select="$direction"/>
  802.             <xsl:value-of select="$navig.graphics.extension"/>
  803.         </xsl:attribute>
  804.         <xsl:attribute name="alt">
  805.             <xsl:value-of select="$navtext"/>
  806.         </xsl:attribute>
  807.         </img>
  808.     </xsl:when>
  809.     <xsl:otherwise>
  810.         <xsl:value-of select="$navtext"/>
  811.     </xsl:otherwise>
  812.     </xsl:choose>
  813. </xsl:template>
  814.  
  815. <!-- ==================================================================== -->
  816.  
  817. <xsl:template match="processing-instruction('dbhtml')">
  818.   <!-- nop -->
  819. </xsl:template>
  820.  
  821. <!-- ==================================================================== -->
  822.  
  823. <xsl:template name="chunk-element-content">
  824.   <xsl:param name="prev"/>
  825.   <xsl:param name="next"/>
  826.   <xsl:param name="nav.context"/>
  827.   <xsl:param name="content"/>
  828.  
  829.   <html xmlns="http://www.w3.org/1999/xhtml">
  830.     <xsl:call-template name="html.head">
  831.       <xsl:with-param name="prev" select="$prev"/>
  832.       <xsl:with-param name="next" select="$next"/>
  833.     </xsl:call-template>
  834.  
  835.     <body>
  836.       <xsl:call-template name="body.attributes"/>
  837.       <xsl:call-template name="user.header.navigation"/>
  838.  
  839.       <xsl:call-template name="header.navigation">
  840.     <xsl:with-param name="prev" select="$prev"/>
  841.     <xsl:with-param name="next" select="$next"/>
  842.     <xsl:with-param name="nav.context" select="$nav.context"/>
  843.       </xsl:call-template>
  844.  
  845.       <xsl:call-template name="user.header.content"/>
  846.  
  847.       <xsl:choose>
  848.         <xsl:when test="$content">
  849.           <xsl:copy-of select="$content"/>
  850.         </xsl:when>
  851.         <xsl:otherwise>
  852.           <xsl:apply-imports/>
  853.         </xsl:otherwise>
  854.       </xsl:choose>
  855.  
  856.       <xsl:call-template name="user.footer.content"/>
  857.  
  858.       <xsl:call-template name="footer.navigation">
  859.     <xsl:with-param name="prev" select="$prev"/>
  860.     <xsl:with-param name="next" select="$next"/>
  861.     <xsl:with-param name="nav.context" select="$nav.context"/>
  862.       </xsl:call-template>
  863.  
  864.       <xsl:call-template name="user.footer.navigation"/>
  865.     </body>
  866.   </html>
  867. </xsl:template>
  868.  
  869. </xsl:stylesheet>
  870.