-
Notifications
You must be signed in to change notification settings - Fork 1
/
function-inventory.xsl
85 lines (85 loc) · 2.7 KB
/
function-inventory.xsl
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
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:djb="http://www.obdurodon.org"
xmlns:math="http://www.w3.org/2005/xpath-functions/math" exclude-result-prefixes="#all"
xmlns="http://www.w3.org/1999/xhtml" version="3.0">
<xsl:output method="xml" indent="yes"/>
<xsl:function name="djb:title-case" as="xs:string">
<xsl:param name="input" as="xs:string"/>
<xsl:sequence select="upper-case(substring($input, 1, 1)) || substring($input, 2)"/>
</xsl:function>
<xsl:template match="/">
<html>
<head>
<title>Function inventory</title>
<link type="text/css" rel="stylesheet" href="http://www.obdurodon.org/css/style.css"
/>
</head>
<body>
<h1>Function inventory</h1>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="package">
<hr/>
<section id="{@name}">
<h2>
<xsl:text>Package: </xsl:text>
<xsl:value-of select="@name"/>
</h2>
<p>
<strong>Location: </strong>
<em>
<xsl:value-of select="@url"/>
</em>
</p>
<xsl:apply-templates select="imports"/>
<dl>
<xsl:apply-templates select="* except imports"/>
</dl>
</section>
</xsl:template>
<xsl:template match="imports">
<p>
<strong>Imports: </strong>
<em>
<xsl:value-of select="string-join(package-import, ', ')"/>
</em>
</p>
</xsl:template>
<xsl:template match="final | private">
<h3>
<xsl:value-of select="djb:title-case(name())"/>
</h3>
<xsl:apply-templates>
<xsl:sort/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="function">
<dt>
<code>
<xsl:apply-templates select="name"/>
</code>
</dt>
<dd>
<ul>
<xsl:apply-templates select="* except name"/>
</ul>
</dd>
</xsl:template>
<xsl:template match="description | arity | note">
<li>
<strong>
<xsl:value-of select="djb:title-case(name())"/>
<xsl:text>: </xsl:text>
</strong>
<xsl:apply-templates/>
</li>
</xsl:template>
<xsl:template match="code">
<code>
<xsl:apply-templates/>
</code>
</xsl:template>
</xsl:stylesheet>