Project

Profile

Help

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

he / tools / doc-page.xsl @ 5d25f10d

1
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2
    xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0">
3
    
4
    <!-- Stylesheet used to build the main documentation pages for the different product 
5
        versions, and for the static HTML and dynamic XML versions of the website. -->
6
    
7
    <xsl:import href="contents-table.xsl"/>
8

    
9
    <xsl:output method="xhtml" indent="yes"/>
10
    <xsl:strip-space elements="*"/>
11

    
12
    <xsl:param name="version-number"/>
13
    <xsl:param name="method"/>
14
    <xsl:param name="major-version"/>
15

    
16
    <xsl:template match="version[@number = $version-number]">
17
        <xsl:if test="$method = 'dynamic'">
18
            <xsl:processing-instruction name="xml-stylesheet">href="../make-menu.xsl" type="text/xsl"</xsl:processing-instruction>
19
        </xsl:if>
20
        <html>
21
            <head>
22
                <this-is section="documentation" page="documentation" folder="{./@dir}"
23
                    subpage=""/>
24
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
25
                <title>Saxonica: Saxon <xsl:value-of select="$version-number"/> Documentation</title>
26
                <meta name="coverage" content="Worldwide"/>
27
                <meta name="copyright" content="Copyright Saxonica Ltd"/>
28
                <xsl:choose>
29
                    <xsl:when test="$method='static' and $version-number = $major-version">
30
                        <meta name="robots" content="index, follow"/>
31
                    </xsl:when>
32
                    <xsl:otherwise>
33
                        <meta name="robots" content="index, nofollow"/>
34
                    </xsl:otherwise>
35
                </xsl:choose> 
36
            </head>
37
            <body class="main">
38
                <h1>Saxon <xsl:value-of select="$version-number"/> Documentation</h1>
39
                <xsl:variable name="saxon-release">
40
                    <xsl:choose>
41
                        <xsl:when test="$version-number = $major-version">Saxon 
42
                            <xsl:value-of select="$version-number"/> (the latest
43
                            release)</xsl:when>
44
                        <xsl:otherwise>Saxon <xsl:value-of select="$version-number"/>
45
                        </xsl:otherwise>
46
                    </xsl:choose>
47
                </xsl:variable>
48
                <p>Select which Saxon version you are interested in from the list below, or use the
49
                    menu on the right to go directly to the documentation for <xsl:value-of
50
                        select="$saxon-release"/>. </p>
51
                <xsl:if test="$method = 'dynamic'">
52
                    <xsl:choose>
53
                        <xsl:when test="$version-number &gt;= 9.9">
54
                            <p>
55
                                <i>Two versions of the documentation are provided: an
56
                                    interactive version driven by <a class="bodylink" href="../saxon-js/index.xml"
57
                                        >Saxon-JS</a> in the browser, and an alternative static HTML page
58
                                    version for non-Javascript browsers.</i>
59
                            </p>
60
                        </xsl:when>
61
                        <xsl:otherwise>
62
                            <p>
63
                                <i>Since Saxon 9.4, we provide two versions of the documentation: an
64
                                    interactive version driven by <a class="bodylink" href="../ce/index.xml"
65
                                        >Saxon-CE</a> in the browser, and an alternative static HTML page
66
                                    version for non-Javascript browsers.</i>
67
                            </p>
68
                        </xsl:otherwise>
69
                    </xsl:choose>
70
                </xsl:if>
71

    
72
                <xsl:if test="$version-number &gt;= 9.7">
73
                    <h2>Server Processing: Saxon-HE, Saxon-PE and Saxon-EE</h2>
74
                </xsl:if>
75

    
76
                <xsl:if test="$method = 'dynamic'">
77
                    <xsl:call-template name="doc-table-dynamic"/>
78
                </xsl:if>
79

    
80
                <xsl:if test="$method = 'static'">
81
                    <xsl:call-template name="doc-table-static"/>
82
                </xsl:if>
83
                
84
                <xsl:if test="$version-number &gt;= 9.7">
85
                    <xsl:call-template name="SaxonC"/>
86
                </xsl:if>
87

    
88
                <xsl:if test="$version-number &gt;= 9.7">
89
                    <xsl:call-template name="browser-information"/>
90
                </xsl:if>
91

    
92
                <h2>Documentation for earlier releases</h2>
93
                <ul class="index-list">
94
                    <xsl:for-each select="/documentation-pages/version[number(@number) lt number($version-number)]">
95
                        <li>
96
                            <xsl:if test="$method = 'dynamic'">
97
                                <a href="../{@dir}/{index-link/@dynamic}" class="bodylink">Saxon
98
                                        <xsl:value-of select="@number"/> documentation</a>
99
                            </xsl:if>
100
                            <xsl:if test="$method = 'static'">
101
                                <xsl:choose>
102
                                    <xsl:when test="number(@number) lt 9.3">
103
                                        <a href="../../{@dir}/{index-link/@static}" class="bodylink"
104
                                            >Saxon <xsl:value-of select="@number"/>
105
                                            documentation</a>
106
                                    </xsl:when>
107
                                    <xsl:otherwise>
108
                                        <a href="../{@dir}/{index-link/@static}" class="bodylink"
109
                                            >Saxon <xsl:value-of select="@number"/>
110
                                            documentation</a>
111
                                    </xsl:otherwise>
112
                                </xsl:choose>
113
                            </xsl:if>
114
                        </li>
115
                    </xsl:for-each>
116
                </ul>
117

    
118
                <div id="fixed-aside">
119
                    <xsl:call-template name="doc-contents-table">
120
                        <xsl:with-param name="method" select="$method"/>
121
                        <xsl:with-param name="version-number" select="$version-number"/>
122
                    </xsl:call-template>
123
                </div>
124
            </body>
125
        </html>
126
    </xsl:template>
127

    
128
    <xsl:template name="doc-table-dynamic">
129
        <table class="doc-table">
130
            <xsl:for-each select="dynamic-page/documentation">
131
                <xsl:variable name="documentation-name">
132
                    <xsl:value-of select="concat('Saxon ',$version-number, ' ')"/>
133
                    <xsl:choose>
134
                        <xsl:when test="@type = 'Saxon'">
135
                            <xsl:text>documentation</xsl:text>
136
                        </xsl:when>
137
                        <xsl:otherwise>
138
                            <xsl:value-of select="@type"/>
139
                        </xsl:otherwise>
140
                    </xsl:choose>
141
                </xsl:variable>
142
                <xsl:variable name="folder-path-dynamic">
143
                    <xsl:if test="ancestor::version/@dir ne ancestor::version/@dynamic">
144
                        <xsl:value-of select="concat('../',ancestor::version/@dynamic,'/')"/>
145
                    </xsl:if>
146
                </xsl:variable>
147
                <tr>
148
                    <td>
149
                        <xsl:if test="@dynamic">
150
                            <a href="{$folder-path-dynamic}{@dynamic}" class="bodylink">
151
                                <div class="DocButton">
152
                                    <b>
153
                                        <xsl:value-of select="$documentation-name"/>
154
                                        <br/>(interactive XML version)</b>
155
                                </div>
156
                            </a>
157
                        </xsl:if>
158
                    </td>
159
                    <td>
160
                        <a href="{@static}" class="bodylink">
161
                            <div class="DocButton"><xsl:value-of select="$documentation-name"
162
                                /><br/>(static HTML version)</div>
163
                        </a>
164
                    </td>
165
                </tr>
166
            </xsl:for-each>
167
        </table>
168
    </xsl:template>
169

    
170
    <xsl:template name="doc-table-static">
171
        <table class="doc-table">
172
            <xsl:for-each select="static-page/documentation">
173
                <xsl:variable name="documentation-name">
174
                    <xsl:value-of select="concat('Saxon ',$version-number, ' ')"/>
175
                    <xsl:choose>
176
                        <xsl:when test="@type = 'Saxon'">
177
                            <xsl:text>documentation</xsl:text>
178
                        </xsl:when>
179
                        <xsl:otherwise>
180
                            <xsl:value-of select="@type"/>
181
                        </xsl:otherwise>
182
                    </xsl:choose>
183
                </xsl:variable>
184
                <tr>
185
                    <td>
186
                        <a href="{@static}" class="bodylink">
187
                            <div class="DocButton">
188
                                <b>
189
                                    <xsl:value-of select="$documentation-name"/>
190
                                </b>
191
                            </div>
192
                        </a>
193
                    </td>
194
                </tr>
195
            </xsl:for-each>
196
        </table>
197
    </xsl:template>
198
    
199
    <xsl:template name="SaxonC">
200
        <h2>Server Processing for C/C++, PHP and Python: Saxon-HE/C, Saxon-PE/C, Saxon-EE/C</h2>
201
        <xsl:if test="$method = 'dynamic'">
202
            <table class="doc-table">
203
                <xsl:for-each select="dynamic-page/saxonc">
204
                    <tr>
205
                        <td>
206
                            <a href="{@dynamic}" class="bodylink">
207
                                <div class="DocButton">
208
                                    <b>
209
                                        <xsl:value-of select="@type"/>
210
                                        documentation<br/>(interactive XML version)</b>
211
                                </div>
212
                            </a>
213
                        </td>
214
                    </tr>
215
                </xsl:for-each>
216
            </table>
217
        </xsl:if>
218
        <xsl:if test="$method = 'static'">
219
            <table class="doc-table">
220
                <xsl:for-each select="static-page/saxonc">
221
                    <tr>
222
                        <td><!-- Note only dynamic documentation app available for Saxon-C -->
223
                            <a href="{@dynamic}" class="bodylink">
224
                                <div class="DocButton">
225
                                    <b>
226
                                        <xsl:value-of select="@type"/>
227
                                        documentation<br/>(interactive XML)</b>
228
                                </div>
229
                            </a>
230
                        </td>
231
                    </tr>
232
                </xsl:for-each>
233
            </table>
234
        </xsl:if>
235
    </xsl:template>
236

    
237
    <xsl:template name="browser-information">
238
        <h2>Browser Processing: Saxon-JS</h2>
239
        <xsl:if test="$method = 'dynamic'">
240
            <table class="doc-table">
241
                <xsl:for-each select="dynamic-page/browser">
242
                    <tr>
243
                        <td>
244
                            <a href="{@dynamic}" class="bodylink">
245
                                <div class="DocButton">
246
                                    <b>
247
                                        <xsl:value-of select="@type"/>
248
                                        documentation<br/>(interactive XML)</b>
249
                                </div>
250
                            </a>
251
                        </td>
252
                    </tr>
253
                </xsl:for-each>
254
            </table>
255
        </xsl:if>
256
        <xsl:if test="$method = 'static'">
257
            <table class="doc-table">
258
                <xsl:for-each select="static-page/browser">
259
                    <tr>
260
                        <td><!-- Note only dynamic documentation app available for Saxon-JS -->
261
                            <a href="{@dynamic}" class="bodylink">
262
                                <div class="DocButton">
263
                                    <b>
264
                                        <xsl:value-of select="@type"/> 
265
                                        documentation<br/>(interactive XML)</b>
266
                                </div>
267
                            </a>
268
                        </td>
269
                    </tr>
270
                </xsl:for-each>
271
            </table>
272
        </xsl:if>
273
    </xsl:template>
274
    
275
</xsl:stylesheet>
(7-7/15)