blob: 9695c8876476f7bb11bece3c59cde68bae145108 (
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:include href="xhtml.templates.xsl"/>
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<h1>The Scala F.A.Q.</h1>
<body bgcolor="#FFFFFF">
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="faq">
<table>
<tr><th>Table of Contents</th></tr>
<xsl:for-each select="./section">
<tr>
<td>
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat('#',generate-id(.))"/>
</xsl:attribute>
<xsl:number/>. <xsl:value-of select="@title"/>
</a>
</td>
</tr>
<xsl:for-each select="./entry">
<tr>
<td>
<a>
<xsl:attribute name="href">
#<xsl:call-template name="entry.getId"/>
</xsl:attribute>
<xsl:call-template name="entry.fullName"/>
</a>
</td>
</tr>
</xsl:for-each>
</xsl:for-each>
</table>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="section">
<p/><p/>
<xsl:param name="id"/>
<b><a>
<xsl:attribute name="name">
<xsl:value-of select="generate-id()"/>
</xsl:attribute>
<xsl:number/>. <xsl:value-of select="@title"/>
</a></b>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="entry">
<p><b>
<a>
<xsl:attribute name="name">
<xsl:call-template name="entry.getId"/>
</xsl:attribute>
<xsl:call-template name="entry.fullName"/>
</a></b>
<br/>
<xsl:apply-templates select="./answer"/>
</p>
</xsl:template>
<xsl:template match="seealso">
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat('#',@ref)"/>
</xsl:attribute>
<xsl:for-each select="id(@ref)">
<xsl:call-template name="entry.fullName"/>
</xsl:for-each>
</a>
</xsl:template>
<xsl:template match="code">
<pre><xsl:value-of select="."/></pre>
</xsl:template>
<xsl:template name="entry.fullName">
<xsl:number level="multiple" count="section|entry"/>.
<xsl:value-of select="./question"/>
</xsl:template>
<xsl:template name="entry.getId">
<xsl:choose>
<xsl:when test="string(@id)">
<xsl:value-of select="@id"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="generate-id()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
|