-
Notifications
You must be signed in to change notification settings - Fork 5
/
specgen.xsl
44 lines (44 loc) · 1.53 KB
/
specgen.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
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:rng="http://relaxng.org/ns/structure/1.0"
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">
<xsl:template match="rng:grammar">
<html>
<head>
<title>OPML Grammar</title>
</head>
<body>
<h2>Elements</h2>
<ul>
<xsl:apply-templates select="//rng:element">
<xsl:sort select="@name"/>
</xsl:apply-templates>
</ul>
<h2>Attributes</h2>
<ul>
<xsl:apply-templates select="//rng:attribute">
<xsl:sort select="@name"/>
</xsl:apply-templates>
</ul>
</body>
</html>
</xsl:template>
<xsl:template match="rng:element">
<li id="#el_{@name}" class="element">
<div class="name">
<xsl:value-of select="@name" />
</div>
<xsl:if test="a:documentation">
<div class="documentation">
<xsl:value-of select="a:documentation" />
</div>
</xsl:if>
</li>
</xsl:template>
<xsl:template match="rng:attribute">
<li id="#att_{@name}" class="element">
<div class="name">
<xsl:value-of select="@name"/>
</div>
</li>
</xsl:template>
</xsl:stylesheet>