Debian Codegraph @

helper/xsl_to_v74/convert42to43.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
7 <!-- default rule -->
8 <xsl:template match="*" mode="conv42to43">
9 <xsl:copy>
10 <xsl:copy-of select="@*"/>
11 <xsl:apply-templates mode="conv42to43"/>
12 </xsl:copy>
13 </xsl:template>
14
15 <!-- version update -->
16 <para xmlns="http://docbook.org/ns/docbook">
17 Changed attribute <tag class="attribute">schemaversion</tag>
18 to <tag class="attribute">schemaversion</tag> from
19 <literal>4.2</literal> to <literal>4.3</literal>. Moved the
20 <tag class="attribute">lvmgroup</tag> attribute from the
21 <tag class="element">type</tag> to the
22 <tag class="element">lvmvolumes</tag> element.
23 </para>
24 <xsl:template match="image" mode="conv42to43">
25 <xsl:choose>
26 <!-- nothing to do if already at 4.3 -->
27 <xsl:when test="@schemaversion > 4.2">
28 <xsl:copy-of select="."/>
29 </xsl:when>
30 <!-- otherwise apply templates -->
31 <xsl:otherwise>
32 <image schemaversion="4.3">
33 <xsl:copy-of select="@*[local-name() != 'schemaversion']"/>
34 <xsl:apply-templates mode="conv42to43"/>
35 </image>
36 </xsl:otherwise>
37 </xsl:choose>
38 </xsl:template>
39
40 <!-- toplevel processing instructions and comments -->
41 <xsl:template match="processing-instruction()|comment()" mode="conv42to43">
42 <xsl:copy>
43 <xsl:copy-of select="@*"/>
44 <xsl:apply-templates mode="conv42to43"/>
45 </xsl:copy>
46 </xsl:template>
47
48 <xsl:template match="preferences" mode="conv42to43">
49 <preferences>
50 <xsl:copy-of select="@*"/>
51 <xsl:apply-templates mode="conv42to43"/>
52 </preferences>
53 </xsl:template>
54
55 <xsl:template match="type" mode="conv42to43">
56 <xsl:choose>
57 <xsl:when test="@lvmgroup">
58 <type>
59 <xsl:copy-of select="@*[local-name() != 'lvmgroup']"/>
60 <xsl:for-each select="*">
61 <xsl:choose>
62 <xsl:when test="name() = 'lvmvolumes'">
63 <lvmvolumes>
64 <xsl:attribute name="lvmgroup">
65 <xsl:value-of select="../@lvmgroup"/>
66 </xsl:attribute>
67 <xsl:apply-templates mode="conv42to43"/>
68 </lvmvolumes>
69 </xsl:when>
70 <xsl:otherwise>
71 <xsl:copy-of select="."/>
72 </xsl:otherwise>
73 </xsl:choose>
74 </xsl:for-each>
75 </type>
76 </xsl:when>
77 <xsl:otherwise>
78 <xsl:copy-of select="."/>
79 </xsl:otherwise>
80 </xsl:choose>
81 </xsl:template>
82 </xsl:stylesheet>