-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:siha="http://www.a-sit.at/siha">
-<!--
 
    ************************************************************
    ** Table of Content (fo/toc.xsl)
    ************************************************************
   
-->
-<xsl:template name="createTOC">
-<fo:block break-before="page" xsl:use-attribute-sets="toc.style">
<fo:block xsl:use-attribute-sets="toc.h1.style">INHALT</fo:block>
-<xsl:if test="boolean(/descendant::siha:meta/siha:booksubtitle)">
-<fo:block xsl:use-attribute-sets="toc.h1.style">
<xsl:value-of select="/descendant::siha:meta/siha:booksubtitle"/>
</fo:block>
</xsl:if>
<xsl:apply-templates select="//siha:chapter" mode="toc"/>
<xsl:apply-templates select="//siha:appendix" mode="toc"/>
</fo:block>
<fo:block break-before="page"> </fo:block>
</xsl:template>
-<!--
 
    ************************************************************
    ** prolog mode="toc"
    ************************************************************
   
-->
-<xsl:template match="siha:chapter[1]" mode="toc">
-<xsl:choose>
-<!--
  wenn 1.Kapitel keine nummerierung dann wahrscheinlich ein vorwort ...  
-->
-<xsl:when test="not(//siha:chapter[1]/siha:title/siha:ordinal)">
-<xsl:call-template name="createTOCHeader">
<xsl:with-param name="reference" select="'#PROLOG '"/>
</xsl:call-template>
</xsl:when>
-<!--
  ... ansonsten kein vorwort   
-->
-<xsl:otherwise>
-<xsl:call-template name="createTOCHeader">
<xsl:with-param name="reference" select="'#CHAPTER '"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-<!--
 
    ************************************************************
    ** chapter mode="toc"
    ************************************************************
   
-->
-<xsl:template match="siha:chapter" mode="toc">
-<xsl:call-template name="createTOCHeader">
<xsl:with-param name="reference" select="'#CHAPTER '"/>
</xsl:call-template>
</xsl:template>
-<xsl:template name="createTOCHeader">
<xsl:param name="reference"/>
-<fo:block xsl:use-attribute-sets="toc.h2.style">
-<xsl:call-template name="setReference">
<xsl:with-param name="ref.name" select="$reference"/>
<xsl:with-param name="ref.ordinal" select="''"/>
</xsl:call-template>
</fo:block>
<xsl:apply-templates mode="toc" select="node()"/>
</xsl:template>
-<!--
 
    ************************************************************
    ** section mode="toc"
    ************************************************************
   
-->
-<xsl:template match="siha:section" mode="toc">
-<!--
  
      start-indent="{(count(ancestor::*)-1)*5}px"
    <fo:block>
      <fo:leader />
    </fo:block>
        
-->
-<fo:block xsl:use-attribute-sets="toc.h3.style">
-<xsl:call-template name="setReference">
<xsl:with-param name="ref.name" select="'#SECTION '"/>
-<xsl:with-param name="ref.ordinal">
<xsl:call-template name="setOrdinalSection"/>
</xsl:with-param>
</xsl:call-template>
</fo:block>
<xsl:apply-templates mode="toc" select="node()"/>
</xsl:template>
-<!--
 
    ************************************************************
    ** subsection mode="toc"
    ************************************************************
   
-->
-<xsl:template match="siha:subsection" mode="toc">
-<!--
  
      start-indent="{(count(ancestor::*)-1)*5}px"
        
-->
-<fo:block xsl:use-attribute-sets="toc.h4.style">
-<xsl:call-template name="setReference">
<xsl:with-param name="ref.name" select="'#SUBSECTION '"/>
-<xsl:with-param name="ref.ordinal">
<xsl:call-template name="setOrdinalSubsection"/>
</xsl:with-param>
</xsl:call-template>
</fo:block>
<xsl:apply-templates mode="toc" select="node()"/>
</xsl:template>
-<!--
 
    ************************************************************
    ** subsubsection mode="toc"
    ************************************************************
   
-->
-<xsl:template match="siha:subsubsection" mode="toc">
-<!--
  
      start-indent="{(count(ancestor::*)-1)*5}px"
    <fo:block>
    </fo:block>
        
-->
-<fo:block xsl:use-attribute-sets="toc.h5.style">
-<xsl:call-template name="setReference">
<xsl:with-param name="ref.name" select="'#SUBSUBSECTION '"/>
-<xsl:with-param name="ref.ordinal">
<xsl:call-template name="setOrdinalSubsubsection"/>
</xsl:with-param>
</xsl:call-template>
</fo:block>
-<!--
     <xsl:apply-templates select="node()" mode="toc"/>
 
-->
</xsl:template>
-<!--
 
    ************************************************************
    ** appendix mode="toc"
    ************************************************************
   
-->
-<xsl:template match="siha:appendix" mode="toc">
-<!--
  
      start-indent="{(count(ancestor::*)-1)*5}px"
        
-->
-<fo:block xsl:use-attribute-sets="toc.h2.style">
<xsl:call-template name="setRefAppendix"/>
</fo:block>
<xsl:apply-templates select="node()" mode="toc"/>
</xsl:template>
-<!--
 
    ************************************************************
    ** trap-doors mode="toc"
    ************************************************************
   
-->
<xsl:template match="siha:topic" mode="toc"/>
<xsl:template match="siha:title" mode="toc"/>
<xsl:template match="siha:detailed" mode="toc"/>
<xsl:template match="siha:abstract" mode="toc"/>
<xsl:template match="siha:itemize" mode="toc"/>
<xsl:template match="siha:enumerate" mode="toc"/>
<xsl:template match="siha:paragraph" mode="toc"/>
<xsl:template match="siha:table" mode="toc"/>
<xsl:template match="siha:meta" mode="toc"/>
</xsl:stylesheet>