Debian Codegraph @

helper/xsl_to_v74/convert24to35.xsl

raw
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4 <xsl:output method="xml"
5 indent="yes" omit-xml-declaration="no" encoding="utf-8"/>
6 <xsl:strip-space elements="type"/>
7
8 <!-- default rule -->
9 <xsl:template match="*" mode="conv24to35">
10 <xsl:copy>
11 <xsl:copy-of select="@*"/>
12 <xsl:apply-templates mode="conv24to35"/>
13 </xsl:copy>
14 </xsl:template>
15
16 <!-- version update -->
17 <para xmlns="http://docbook.org/ns/docbook">
18 Changed attribute <tag class="attribute">schemeversion</tag>
19 to <tag class="attribute">schemaversion</tag> from
20 <literal>2.4</literal> to <literal>3.5</literal>.
21 </para>
22 <xsl:template match="image" mode="conv24to35">
23 <xsl:choose>
24 <!-- nothing to do if already at 3.5 -->
25 <xsl:when test="@schemaversion > 2.4 or @schemeversion > 2.4">
26 <xsl:copy-of select="."/>
27 </xsl:when>
28 <!-- otherwise apply templates -->
29 <xsl:otherwise>
30 <image schemaversion="3.5">
31 <xsl:copy-of select="@*[local-name() != 'schemeversion']"/>
32 <xsl:apply-templates mode="conv24to35"/>
33 </image>
34 </xsl:otherwise>
35 </xsl:choose>
36 </xsl:template>
37
38 <!-- toplevel processing instructions and comments -->
39 <xsl:template match="processing-instruction()|comment()" mode="conv24to35">
40 <xsl:copy>
41 <xsl:copy-of select="@*"/>
42 <xsl:apply-templates mode="conv24to35"/>
43 </xsl:copy>
44 </xsl:template>
45
46 <!-- remove compressed element -->
47 <para xmlns="http://docbook.org/ns/docbook">
48 Remove compressed element as it was moved into the type
49 </para>
50 <xsl:template match="node()|@*">
51 <xsl:copy>
52 <xsl:apply-templates select="node()|@*" mode="conv24to35"/>
53 </xsl:copy>
54 </xsl:template>
55 <xsl:template match="compressed" mode="conv24to35"/>
56
57 </xsl:stylesheet>