summaryrefslogtreecommitdiff
path: root/doc/tools/spec-strip-docs.xsl
blob: 21ad5582abe0b287e951757bc1bf1743282b102b (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
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd"
  exclude-result-prefixes="doc">

  <xsl:output method="xml" indent="yes" encoding="UTF-8"
    omit-xml-declaration="no"
    doctype-system="http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"
    doctype-public="-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" />

  <xsl:template match="*">
    <xsl:copy>
      <xsl:for-each select="@*">
        <xsl:if test="not(starts-with(name(.), 'doc:'))">
          <xsl:copy/>
        </xsl:if>
      </xsl:for-each>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="node">
    <node>
      <xsl:for-each select="@*">
        <xsl:if test="not(starts-with(name(.), 'xmlns'))">
          <xsl:copy/>
        </xsl:if>
      </xsl:for-each>
      <xsl:apply-templates/>
    </node>
  </xsl:template>

  <xsl:template match="doc:*"/>
  <xsl:template match="text()"/>

</xsl:stylesheet>