summaryrefslogtreecommitdiffstats
path: root/docbook/fixhtml.xsl
blob: 6089af43a3e190a124d36c3078d7df514d519afe (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
<?xml version='1.0'?>
<xsl:stylesheet
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<!-- Zap empty <a> nodes -->

<xsl:template match="xhtml:a">

  <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
    <xsl:if test="count(child::node()) = 0">
      <xsl:text> </xsl:text>
    </xsl:if>
  </xsl:copy>

</xsl:template>

<xsl:template match="@*|node()">
  <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
  </xsl:copy>
</xsl:template>


</xsl:stylesheet>