summaryrefslogtreecommitdiff
path: root/docs/xslt/strip-references.xsl
diff options
context:
space:
mode:
Diffstat (limited to 'docs/xslt/strip-references.xsl')
-rw-r--r--docs/xslt/strip-references.xsl42
1 files changed, 42 insertions, 0 deletions
diff --git a/docs/xslt/strip-references.xsl b/docs/xslt/strip-references.xsl
new file mode 100644
index 0000000000..568aecafd2
--- /dev/null
+++ b/docs/xslt/strip-references.xsl
@@ -0,0 +1,42 @@
+<?xml version='1.0'?>
+<!-- Removes particular (unuseful for the book) elements from references -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.1">
+ <xsl:template match="reference/refentry/refsect1">
+ <xsl:if test="title!='VERSION' and title!='AUTHOR'">
+ <xsl:element name="refsect1">
+ <xsl:if test="@id!=''">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="reference/refentry">
+ <xsl:element name="section">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ <xsl:element name="title">
+ <xsl:value-of select="refmeta/refentrytitle"/>
+ </xsl:element>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="reference/refentry/refmeta"/>
+
+ <xsl:template match="reference/refentry/refnamediv"/>
+
+ <xsl:template match="reference">
+ <xsl:element name="appendix">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+</xsl:stylesheet>