Debian Codegraph @

helper/xsl_to_v74/convert73to74.xsl

raw
1 <?xml version="1.0" encoding="utf-8"?>
2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3 <xsl:output method="xml"
4 indent="yes" omit-xml-declaration="no" encoding="utf-8"/>
5
6 <!-- default rule -->
7 <xsl:template match="*" mode="conv73to74">
8 <xsl:copy>
9 <xsl:copy-of select="@*"/>
10 <xsl:apply-templates mode="conv73to74"/>
11 </xsl:copy>
12 </xsl:template>
13
14 <!-- version update -->
15 <para xmlns="http://docbook.org/ns/docbook">
16 Changed attribute <tag class="attribute">schemaversion</tag>
17 to <tag class="attribute">schemaversion</tag> from
18 <literal>7.3</literal> to <literal>7.4</literal>.
19 </para>
20 <xsl:template match="image" mode="conv73to74">
21 <xsl:choose>
22 <!-- nothing to do if already at 7.4 -->
23 <xsl:when test="@schemaversion > 7.3">
24 <xsl:copy-of select="."/>
25 </xsl:when>
26 <!-- otherwise apply templates -->
27 <xsl:otherwise>
28 <image schemaversion="7.4">
29 <xsl:copy-of select="@*[local-name() != 'schemaversion']"/>
30 <xsl:apply-templates mode="conv73to74"/>
31 </image>
32 </xsl:otherwise>
33 </xsl:choose>
34 </xsl:template>
35
36 <!-- toplevel processing instructions and comments -->
37 <xsl:template match="processing-instruction()|comment()" mode="conv73to74">
38 <xsl:copy>
39 <xsl:copy-of select="@*"/>
40 <xsl:apply-templates mode="conv73to74"/>
41 </xsl:copy>
42 </xsl:template>
43
44 <!-- change packagemanager to apt if set to apt-get -->
45 <!-- change packagemanager to dnf if set to yum -->
46 <xsl:template match="packagemanager" mode="conv73to74">
47 <xsl:choose>
48 <xsl:when test="text()='apt-get'">
49 <packagemanager>apt</packagemanager>
50 </xsl:when>
51 <xsl:when test="text()='yum'">
52 <packagemanager>dnf</packagemanager>
53 </xsl:when>
54 <xsl:otherwise>
55 <xsl:copy-of select="."/>
56 </xsl:otherwise>
57 </xsl:choose>
58 </xsl:template>
59
60 </xsl:stylesheet>