generated from w3c/note-respec-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathctopintent.xsl
66 lines (56 loc) · 1.91 KB
/
ctopintent.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
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="3">
<xsl:output method="html" version="5"/>
<xsl:template match="/">
<html>
<head>
<xsl:text> </xsl:text>
<title>Examples from MathML4</title>
<xsl:text> </xsl:text>
<script src="ctop.js"></script>
<xsl:text> </xsl:text>
<script src="ctop-runner.js"></script>
<xsl:text> </xsl:text>
<style>
body {max-width:80em; margin: auto;}
div.section {border: solid thin black; padding:.5em;margin-top:.5em;}
pre.examplecontent{border:solid thin blue;padding:.5em;background-color:#EEE;margin-bottom:0pt;margin-top:1em;}
pre.mml{border:solid thin green;padding:.5em;background-color:#F5F5F5;margin-top:0pt}
math{border:solid thin green;padding:.5em;background-color:#F5F5F5;margin-top:0pt}
</style>
<xsl:text> </xsl:text>
</head>
<xsl:text> </xsl:text>
<body>
<xsl:text> </xsl:text>
<h1>Examples from MathML4</h1>
<xsl:text> </xsl:text>
<xsl:apply-templates/>
</body>
</html>
<xsl:text> </xsl:text>
</xsl:template>
<xsl:template match="section|div[string(h6)]">
<div class="section">
<xsl:apply-templates select="(h1|h2|h3|h4|h5|h6)[1]" mode="keep"/>
<xsl:apply-templates select="*"/>
</div>
</xsl:template>
<xsl:template match="div[@class=('example mathml','example strict-mathml')]">
<pre class="examplecontent">
<xsl:apply-templates mode="pre"/>
</pre>
</xsl:template>
<xsl:template match="div[@class='example mathml'][preceding-sibling::*='Sample Presentation']" priority="2"/>
<xsl:template match="text()"/>
<xsl:template mode="pre" match="text()">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template mode="keep" match="node()">
<xsl:copy>
<xsl:copy-of select="@id"/>
<xsl:apply-templates mode="keep"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>