Debian Codegraph @

helper/xsl_to_v74/convert38to39.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 <xsl:strip-space elements="type"/>
6 <xsl:strip-space elements="preferences"/>
7
8 <!-- default rule -->
9 <xsl:template match="*" mode="conv38to39">
10 <xsl:copy>
11 <xsl:copy-of select="@*"/>
12 <xsl:apply-templates mode="conv38to39"/>
13 </xsl:copy>
14 </xsl:template>
15
16 <!-- version update -->
17 <para xmlns="http://docbook.org/ns/docbook">
18 Changed attribute <tag class="attribute">schemaversion</tag>
19 to <tag class="attribute">schemaversion</tag> from
20 <literal>3.8</literal> to <literal>3.9</literal>.
21 </para>
22 <xsl:template match="image" mode="conv38to39">
23 <xsl:choose>
24 <!-- nothing to do if already at 3.9 -->
25 <xsl:when test="@schemaversion > 3.8">
26 <xsl:copy-of select="."/>
27 </xsl:when>
28 <!-- otherwise apply templates -->
29 <xsl:otherwise>
30 <image schemaversion="3.9">
31 <xsl:copy-of select="@*[local-name() != 'schemaversion']"/>
32 <xsl:apply-templates mode="conv38to39"/>
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="conv38to39">
40 <xsl:copy>
41 <xsl:copy-of select="@*"/>
42 <xsl:apply-templates mode="conv38to39"/>
43 </xsl:copy>
44 </xsl:template>
45
46 <!-- create new element oemconfig -->
47 <para xmlns="http://docbook.org/ns/docbook">
48 Create new <tag class="element">oemconfig</tag> element to collect
49 all <tag class="element">oem-*</tag> elements in one place and remove
50 them from the <tag class="element">preferences</tag> element.
51 </para>
52 <xsl:template match="image" mode="conv38to39">
53 <xsl:variable name="boottitle" select="/image/preferences/oem-boot-title"/>
54 <xsl:variable name="home" select="/image/preferences/oem-home"/>
55 <xsl:variable name="initrd" select="/image/preferences/oem-kiwi-initrd"/>
56 <xsl:variable name="reboot" select="/image/preferences/oem-reboot"/>
57 <xsl:variable name="inplace" select="/image/preferences/oem-inplace-recovery"/>
58 <xsl:variable name="align" select="/image/preferences/oem-align-partition"/>
59 <xsl:variable name="recovery" select="/image/preferences/oem-recovery"/>
60 <xsl:variable name="dumphalt" select="/image/preferences/oem-dumphalt"/>
61 <xsl:variable name="recoveryid" select="/image/preferences/oem-recoveryID"/>
62 <xsl:variable name="sapinstall" select="/image/preferences/oem-sap-install"/>
63 <xsl:variable name="swap" select="/image/preferences/oem-swap"/>
64 <xsl:variable name="swapsize" select="/image/preferences/oem-swapsize"/>
65 <xsl:variable name="systemsize" select="/image/preferences/oem-systemsize"/>
66 <image>
67 <xsl:copy-of select="@*"/>
68 <xsl:apply-templates mode="conv38to39"/>
69
70 <xsl:if test="$boottitle or $home or $initrd or $reboot or $recovery or $recoveryid or $sapinstall or $swap or $swapsize or $systemsize">
71 <oemconfig>
72 <xsl:copy-of select="$boottitle"/>
73 <xsl:copy-of select="$home"/>
74 <xsl:copy-of select="$initrd"/>
75 <xsl:copy-of select="$reboot"/>
76 <xsl:copy-of select="$align"/>
77 <xsl:copy-of select="$inplace"/>
78 <xsl:copy-of select="$recovery"/>
79 <xsl:copy-of select="$recoveryid"/>
80 <xsl:copy-of select="$sapinstall"/>
81 <xsl:copy-of select="$swap"/>
82 <xsl:copy-of select="$swapsize"/>
83 <xsl:copy-of select="$systemsize"/>
84 <xsl:copy-of select="$dumphalt"/>
85 </oemconfig>
86 </xsl:if>
87 </image>
88 </xsl:template>
89
90 <!-- swallow the output for the OEM settings in their current position -->
91 <xsl:template match="preferences/oem-boot-title" mode="conv38to39"/>
92 <xsl:template match="preferences/oem-home" mode="conv38to39"/>
93 <xsl:template match="preferences/oem-kiwi-initrd" mode="conv38to39"/>
94 <xsl:template match="preferences/oem-reboot" mode="conv38to39"/>
95 <xsl:template match="preferences/oem-inplace-recovery" mode="conv38to39"/>
96 <xsl:template match="preferences/oem-align-partition" mode="conv38to39"/>
97 <xsl:template match="preferences/oem-recovery" mode="conv38to39"/>
98 <xsl:template match="preferences/oem-recoveryID" mode="conv38to39"/>
99 <xsl:template match="preferences/oem-sap-install" mode="conv38to39"/>
100 <xsl:template match="preferences/oem-swap" mode="conv38to39"/>
101 <xsl:template match="preferences/oem-swapsize" mode="conv38to39"/>
102 <xsl:template match="preferences/oem-systemsize" mode="conv38to39"/>
103 <xsl:template match="preferences/oem-dumphalt" mode="conv38to39"/>
104
105 </xsl:stylesheet>