summaryrefslogtreecommitdiffstats
path: root/doc/tools/index.xsl
blob: 8d3d0a523a71897495484ff9753ce0706e518983 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes"/>

<xsl:template match="/"><xsl:apply-templates/></xsl:template>

<xsl:template match="text()|@*"></xsl:template>

<xsl:template match="chapter">
  <xsl:variable name="url" select="@id"/>
  <xsl:apply-templates/>   
</xsl:template>  

<xsl:template match="chapter/section[position()!=1]">
  <xsl:variable name="url" select="@id"/>
  <xsl:apply-templates/>   
</xsl:template>  

<xsl:template match="indexterm">
  <xsl:choose>
    <xsl:when test="./secondary and ./tertiary">
    <entry name="{primary}, {secondary}, {tertiary}" url="{$url}.html"/>
    </xsl:when>
    <xsl:when test="./secondary">
    <entry name="{primary}, {secondary}" url="{$url}.html"/>
    </xsl:when>
    <xsl:otherwise>
    <entry name="{primary}" url="{$url}.html"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

</xsl:stylesheet>