<>

Chapter 3. My $SOURCE_DIR/mystyles.xsl

<?xml version='1.0'?>
<xsl:stylesheet  
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:import href="file:///home/imghchco/share/docbook/xsl/html/chunk.xsl"/>

<xsl:param name="appendix.autolabel"                      >A</xsl:param>

<xsl:param name="admon.graphics"                          >1</xsl:param>
<xsl:param name="admon.graphics.path"                     >/doc/images/xsl/</xsl:param>

<xsl:param name="callout.graphics" select="1"></xsl:param>
<xsl:param name="callout.graphics.path">/share/docbook/xsl/images/callouts/</xsl:param>
<xsl:param name="callout.list.table" select="1"></xsl:param>

<xsl:param name="chunk.first.sections"                    >1</xsl:param>

<xsl:param name="chunker.output.encoding"                 >UTF-8</xsl:param>
<xsl:param name="chunker.output.indent"                   >yes</xsl:param>

<xsl:param name="generate.id.attributes"                  >1</xsl:param>

<xsl:param name="html.cleanup"                            >1</xsl:param>
<xsl:param name="html.stylesheet"                         >source/stylesheet.css</xsl:param>


<xsl:param name="img.src.path"                            >images/</xsl:param>

<xsl:param name="section.autolabel"                      >1</xsl:param>
<!--<xsl:param name="section.autolabel.max.depth"            >1</xsl:param>-->
<xsl:param name="section.label.includes.component.label" > 1 </xsl:param>

<xsl:param name="toc.section.depth">1</xsl:param>

<xsl:param name="use.id.as.filename"                      >1</xsl:param>

<!--<xsl:param name="l10n.gentext.language">zh_cn</xsl:param>-->
<!--<xsl:param name="base.dir">/www/doc/</xsl:param>-->


<!--
<xsl:template name="user.footer.content">
  <img src="copyleft.jpg" />
</xsl:template>
-->


<!-- add 'Appendix' -->
<xsl:template name="toc.line">
  <xsl:param name="toc-context" select="."/>
  <xsl:param name="depth" select="1"/>
  <xsl:param name="depth.from.context" select="8"/>



 <span>
  <xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute>

  <!-- * if $autotoc.label.in.hyperlink is zero, then output the label -->
  <!-- * before the hyperlinked title (as the DSSSL stylesheet does) -->
  <xsl:if test="$autotoc.label.in.hyperlink = 0">
    <xsl:variable name="label">
      <xsl:apply-templates select="." mode="label.markup"/>
    </xsl:variable>
    <xsl:copy-of select="$label"/>
    <xsl:if test="$label != ''">
      <xsl:value-of select="$autotoc.label.separator"/>
    </xsl:if>
  </xsl:if>

  <a>
    <xsl:attribute name="href">
      <xsl:call-template name="href.target">
        <xsl:with-param name="context" select="$toc-context"/>
        <xsl:with-param name="toc-context" select="$toc-context"/>
      </xsl:call-template>
    </xsl:attribute>
    
  <!-- * if $autotoc.label.in.hyperlink is non-zero, then output the label -->
  <!-- * as part of the hyperlinked title -->
  <xsl:if test="not($autotoc.label.in.hyperlink = 0)">
    <xsl:variable name="label">
      <xsl:choose>
        <xsl:when test="self::appendix">
          <xsl:call-template name="gentext">
            <xsl:with-param name="key">appendix</xsl:with-param>
          </xsl:call-template>
          <xsl:text> </xsl:text>
          <xsl:apply-templates select="." mode="label.markup"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:apply-templates select="." mode="label.markup"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <xsl:copy-of select="$label"/>
    <xsl:if test="$label != ''">
      <xsl:value-of select="$autotoc.label.separator"/>
    </xsl:if>
  </xsl:if>

    <xsl:apply-templates select="." mode="titleabbrev.markup"/>
  </a>
  </span>
</xsl:template>




<!-- remove chapter and section toc from set index -->
<xsl:template match="book" mode="toc">
  <xsl:param name="toc-context" select="."/>

  <xsl:call-template name="subtoc">
    <xsl:with-param name="toc-context" select="$toc-context"/>
    <xsl:with-param name="nodes" select="EMPTY"/>
  </xsl:call-template>
</xsl:template>




<xsl:template name="user.header.navigation">
  <code class="email">&lt;<a class="email" href="mailto:imghch%20AT%20gmail%20DOT%20com">imghch AT gmail DOT com</a>&gt;</code>
</xsl:template>
<!--
<xsl:template name="user.header.content">
  <p>user.header.content</p>
</xsl:template>

<xsl:template name="user.footer.content">
  <p>user.footer.content</p>
</xsl:template>

<xsl:template name="user.footer.navigation">
  <p>user.footer.navigation</p>
</xsl:template>
-->







<!-- ==================================================================== -->
<xsl:template name="chunk-element-content">
  <xsl:param name="prev"/>
  <xsl:param name="next"/>
  <xsl:param name="nav.context"/>
  <xsl:param name="content">
    <xsl:apply-imports/>
  </xsl:param>

  <xsl:call-template name="user.preroot"/>

  <html>
    <xsl:call-template name="html.head">
      <xsl:with-param name="prev" select="$prev"/>
      <xsl:with-param name="next" select="$next"/>
    </xsl:call-template>
      
    <body>

<div class='wrap'>
      <xsl:call-template name="body.attributes"/>
      <xsl:call-template name="user.header.navigation"/>
          
      <xsl:call-template name="header.navigation">
        <xsl:with-param name="prev" select="$prev"/>
        <xsl:with-param name="next" select="$next"/>
        <xsl:with-param name="nav.context" select="$nav.context"/>
      </xsl:call-template>

      <xsl:call-template name="user.header.content"/>

      <xsl:copy-of select="$content"/>
  
      <xsl:call-template name="user.footer.content"/>
  
      <xsl:call-template name="footer.navigation">
        <xsl:with-param name="prev" select="$prev"/>
        <xsl:with-param name="next" select="$next"/>
        <xsl:with-param name="nav.context" select="$nav.context"/>
      </xsl:call-template>
      
      <xsl:call-template name="user.footer.navigation"/>
</div>

    </body>
  </html>
  <xsl:value-of select="$chunk.append"/>
</xsl:template>

<!-- ==================================================================== -->








</xsl:stylesheet>