Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 368bf8aab37e1266813e6ffb2f1059512113b859 (plain) (blame)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!--

  Stylesheet for creating the file html/toc.html based on tocconcepts.xml
  and toctasks.xml.

-->
<xsl:stylesheet version="1.0" 
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	
  	
  <xsl:template match="/">
    <html>
      <head>
        <title>Vex User Guide</title>
      </head>
      <body>

    <xsl:apply-templates/>
    
      </body>
    </html>
  </xsl:template>

  <xsl:template match="toc" name="toc">
    <xsl:param name="hlevel" select="1"/>
    <xsl:element name="h{$hlevel}">
      <xsl:value-of select="@label"/>
    </xsl:element>
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="topic[anchor]">
    <xsl:for-each select="document(concat('toc', anchor/@id, '.xml'))/toc">
      <xsl:call-template name="toc">
        <xsl:with-param name="hlevel" select="2"/>
      </xsl:call-template>
    </xsl:for-each>
  </xsl:template>
  
  <xsl:template match="topic[topic]">
    <li><a href="{@href}"><xsl:value-of select="@label"/></a></li>
    <ul>
      <xsl:apply-templates/>
    </ul>
  </xsl:template>

  <xsl:template match="topic">
    <li><a href="{@href}"><xsl:value-of select="@label"/></a></li>
  </xsl:template>

</xsl:stylesheet>

Back to the top