Project

Profile

Help

How to connect?
Download (2.85 KB) Statistics
| Branch: | Revision:

he / tools / contents-table.xsl @ 01d6fdb6

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
    xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
4
    
5
    <!-- Stylesheet used by contentsDoc.xsl and doc-page.xsl to build the contents tables 
6
        (with direct links to the main sections of the relevant version of the documentation), 
7
        common to these pages -->
8

    
9
    <xsl:variable name="doc-ref" select="document('doc-ref.xml')"/>
10

    
11
    <xsl:template name="doc-contents-table">
12
        <xsl:param name="method"/>
13
        <xsl:param name="version-number"/>
14
        <xsl:variable name="extension">
15
            <xsl:if test="$method = 'dynamic'">
16
                <xsl:value-of select="'xml'"/>
17
            </xsl:if>
18
            <xsl:if test="$method = 'static'">
19
                <xsl:value-of select="'html'"/>
20
            </xsl:if>
21
        </xsl:variable>
22
        <xsl:variable name="version-ref" select="$doc-ref/*/version[@number = $version-number]"/>
23
        <xsl:variable name="doc-version" select="$version-ref/@dir"/>
24
        <xsl:variable name="doc-entry">
25
            <xsl:if test="$method = 'dynamic'">
26
                <xsl:value-of select="$version-ref/dynamic-page/@doc-entry"/>
27
            </xsl:if>
28
            <xsl:if test="$method = 'static'">
29
                <xsl:value-of select="$version-ref/static-page/@doc-entry"/>
30
            </xsl:if>
31
        </xsl:variable>
32
        <xsl:variable name="doc-extension">
33
            <xsl:choose>
34
                <xsl:when test="$method = 'dynamic'">
35
                    <xsl:value-of select="''"/>
36
                </xsl:when>
37
                <xsl:when test="$method = 'static'">
38
                    <xsl:value-of select="'/index.html'"/>
39
                </xsl:when>
40
            </xsl:choose>
41
        </xsl:variable>
42
        <xsl:variable name="contents-doc" select="concat($doc-version,'/contents.xml')"/>
43
        <h2>Documentation</h2>
44
        <table class="doc-contents">
45
            <!--<tr id="top">
46
                <td>
47
                    <p>
48
                        <a href="documentation.{$extension}">Documentation</a>
49
                    </p>
50
                </td>
51
            </tr>-->
52
            <tr>
53
                <td>
54
                    <p>
55
                        <a href="contents-page.{$extension}">Full Contents</a>
56
                    </p>
57
                </td>
58
            </tr>
59
            <xsl:for-each select="document(concat('../build/website/',$contents-doc))/*/section">
60
                <tr>
61
                    <td>
62
                        <p>
63
                            <a href="{$doc-entry}{@name}{$doc-extension}">
64
                                <xsl:value-of select="@title"/>
65
                            </a>
66
                        </p>
67
                    </td>
68
                </tr>
69
            </xsl:for-each>
70
        </table>
71
    </xsl:template>
72

    
73
</xsl:stylesheet>
(4-4/15)