blob: 4039cd9eb5e0f1f601161ba775a76357a1645c73 (
plain)
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
|
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- default rule -->
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*" />
<xsl:apply-templates />
</xsl:copy>
</xsl:template>
<xsl:template match="code">
<xsl:element name="c"><xsl:apply-templates /></xsl:element>
</xsl:template>
<xsl:template match="div">
<xsl:choose>
<xsl:when test="@class = 'example'">
<example><xsl:apply-templates /></example>
</xsl:when>
<xsl:when test="@class = 'behavior'">
<block type="behavior"><xsl:apply-templates /></block>
</xsl:when>
<xsl:when test="@class = 'default'">
<block type="default"><xsl:apply-templates /></block>
</xsl:when>
<xsl:when test="@class = 'example-block'">
<block type="example"><xsl:apply-templates /></block>
</xsl:when>
<xsl:when test="@class = 'overrides'">
<block type="overrides"><xsl:apply-templates /></block>
</xsl:when>
<xsl:when test="@class = 'usage'">
<block type="usage"><xsl:apply-templates /></block>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="." />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="table">
<list type="table">
<xsl:if test="tr[1]/th">
<listheader><item>
<term>
<xsl:apply-templates select="tr[1]/th[1]" />
</term>
<xsl:for-each select="tr[1]/th[position() > 1]">
<description>
<xsl:apply-templates />
</description>
</xsl:for-each>
</item></listheader>
</xsl:if>
<xsl:for-each select="tr">
<item>
<term>
<xsl:apply-templates select="td[1]" />
</term>
<xsl:for-each select="td[position() > 1]">
<description>
<xsl:apply-templates />
</description>
</xsl:for-each>
</item>
</xsl:for-each>
</list>
</xsl:template>
</xsl:transform>
|