Debian Codegraph @

helper/xsl_to_v74/convert20to24.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="conv20to24">
10 <xsl:copy>
11 <xsl:copy-of select="@*"/>
12 <xsl:apply-templates mode="conv20to24"/>
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 from <literal>2.0</literal> to <literal>2.4</literal>.
20 </para>
21 <xsl:template match="image" mode="conv20to24">
22 <xsl:choose>
23 <!-- nothing to do if already at 2.4 -->
24 <xsl:when test="@schemeversion > 2.0 or @schemaversion > 2.0">
25 <xsl:copy-of select="."/>
26 </xsl:when>
27 <!-- otherwise apply templates -->
28 <xsl:otherwise>
29 <image schemeversion="2.4">
30 <xsl:copy-of select="@*[local-name() != 'schemeversion']"/>
31 <xsl:apply-templates mode="conv20to24"/>
32 </image>
33 </xsl:otherwise>
34 </xsl:choose>
35 </xsl:template>
36
37 <!-- toplevel processing instructions and comments -->
38 <xsl:template match="processing-instruction()|comment()" mode="conv20to24">
39 <xsl:copy>
40 <xsl:copy-of select="@*"/>
41 <xsl:apply-templates mode="conv20to24"/>
42 </xsl:copy>
43 </xsl:template>
44
45 <!-- remove attributes and add info -->
46 <para xmlns="http://docbook.org/ns/docbook">
47 Remove attributes memory,disk,HWversion,guestOS_32Bit and guestOS_64Bit
48 from the <literal>2.0</literal> packages type [vmware|xen] version.
49 This information needs to be provided by an additional
50 <tag class="element">vmwareconfig</tag> or
51 <tag class="element">xenconfig</tag> element
52 </para>
53 <xsl:template match="packages" mode="conv20to24">
54 <packages>
55 <xsl:if test="@memory or
56 @disk or
57 @HWversion or
58 @guestOS_32Bit or
59 @guestOS_64Bit">
60 <xsl:message>
61 <xsl:text>NOTE: You need to setup a vmwareconfig and/or&#10;</xsl:text>
62 <xsl:text> xenconfig section in order to setup an&#10;</xsl:text>
63 <xsl:text> appropriate guest configuration. For&#10;</xsl:text>
64 <xsl:text> details see the 'KIWI image description'&#10;</xsl:text>
65 <xsl:text> chapter of the kiwi cookbook</xsl:text>
66 </xsl:message>
67 </xsl:if>
68 <xsl:copy-of select="@*[not(local-name(.) = 'memory' or
69 local-name(.) = 'disk' or
70 local-name(.) = 'HWversion' or
71 local-name(.) = 'guestOS_32Bit' or
72 local-name(.) = 'guestOS_64Bit')]"/>
73 <xsl:apply-templates mode="conv20to24"/>
74 </packages>
75 </xsl:template>
76
77 </xsl:stylesheet>