-
Notifications
You must be signed in to change notification settings - Fork 0
/
to5.xsl
32 lines (25 loc) · 1.24 KB
/
to5.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
<?xml version='1.0'?>
<!DOCTYPE doc SYSTEM "../../../lib/xml/xsl.dtd" >
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:x="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="x">
<xsl:output omit-xml-declaration="yes"/>
<xsl:template match="x:meta[@name='Content-Type']">
<meta charset="utf-8"/>
</xsl:template>
<xsl:template match="x:script[contains(@src,'respec')]">
<script class="remove" src="http://www.w3.org/Tools/respec/respec-w3c-common"><xsl:apply-templates/></script>
</xsl:template>
<xsl:template match="x:div[@class='section' or @class='figure' or @class='figcaption']">
<xsl:element name="{@class}" namespace="http://www.w3.org/1999/xhtml"><xsl:apply-templates select="node()|@*[local-name()!='class']"/></xsl:element>
</xsl:template>
<xsl:template match="x:div[starts-with(@class,'section ')]">
<section class="{substring(@class,9)}"><xsl:apply-templates select="node()|@*[local-name()!='class']"/></section>
</xsl:template>
<xsl:template match="node()">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@*">
<xsl:copy/>
</xsl:template>
</xsl:stylesheet>