forked from w3c/wcag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate-understanding-toc.xslt
56 lines (49 loc) · 1.57 KB
/
generate-understanding-toc.xslt
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
<?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="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="#all"
version="2.0">
<xsl:output method="xhtml" indent="yes" omit-xml-declaration="yes" encoding="UTF-8"/>
<xsl:template match="guidelines">
<xsl:result-document href="toc.html" method="xhtml" omit-xml-declaration="yes">
<xsl:apply-templates select="principle | guideline | success-criterion"/>
<section id="other">
<h2>Other Understanding documents</h2>
<ul class="toc-wcag-docs">
<xsl:apply-templates select="understanding"/>
</ul>
</section>
</xsl:result-document>
</xsl:template>
<xsl:template match="principle">
<section id="{@id}">
<h2><xsl:value-of select="name"/></h2>
<xsl:apply-templates select="guideline"/>
</section>
</xsl:template>
<xsl:template match="guideline">
<section id="{@id}">
<h3>
<a href="{file/@href}">
<span class="secno"><xsl:value-of select="num"/><xsl:text> </xsl:text></span>
<xsl:value-of select="name"/>
</a>
</h3>
<ul>
<xsl:apply-templates select="success-criterion"/>
</ul>
</section>
</xsl:template>
<xsl:template match="success-criterion">
<li>
<a href="{file/@href}">
<span class="secno"><xsl:value-of select="num"/><xsl:text> </xsl:text></span>
<xsl:value-of select="name"/>
</a>
</li>
</xsl:template>
<xsl:template match="understanding">
<li><a href="{file/@href}"><xsl:value-of select="name"/></a></li>
</xsl:template>
</xsl:stylesheet>