aboutsummaryrefslogtreecommitdiff
path: root/utility/xhtml.xsl
blob: 2f5497550f9f4e81946301436ca2ff42d3fff2ae (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
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
	version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>

<xsl:template match="*" mode="xhtml">
	<xsl:element name="{local-name()}" namespace="http://www.w3.org/1999/xhtml">
		<xsl:copy-of select="@*"/>
		<xsl:apply-templates select="node()" mode="xhtml"/>
	</xsl:element>
</xsl:template>

<xsl:template match="span" mode="xhtml">
	<span>
		<xsl:copy-of select="@*"/>
		<xsl:apply-templates select="node()" mode="xhtml"/>
		<xsl:if test="not(node())">
			<xsl:comment></xsl:comment>
		</xsl:if>
	</span>
</xsl:template>

<xsl:template match="comment() | processing-instruction()" mode="xhtml">
	<xsl:copy/>
</xsl:template>

</xsl:stylesheet>