Debian Codegraph @

helper/xsl_to_v74/convert58to59.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="conv58to59">
8 <xsl:copy>
9 <xsl:copy-of select="@*"/>
10 <xsl:apply-templates mode="conv58to59"/>
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>5.8</literal> to <literal>5.9</literal>.
19 </para>
20 <xsl:template match="image" mode="conv58to59">
21 <xsl:choose>
22 <!-- nothing to do if already at 5.9 -->
23 <xsl:when test="@schemaversion > 5.8">
24 <xsl:copy-of select="."/>
25 </xsl:when>
26 <!-- otherwise apply templates -->
27 <xsl:otherwise>
28 <image schemaversion="5.9">
29 <xsl:copy-of select="@*[local-name() != 'schemaversion']"/>
30 <xsl:apply-templates mode="conv58to59"/>
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="conv58to59">
38 <xsl:copy>
39 <xsl:copy-of select="@*"/>
40 <xsl:apply-templates mode="conv58to59"/>
41 </xsl:copy>
42 </xsl:template>
43
44 <!-- rename controller="scsi" to controller="lsilogic" in vmdisk -->
45 <para xmlns="http://docbook.org/ns/docbook">
46 rename controller="scsi" to controller="lsilogic" in vmdisk
47 </para>
48 <xsl:template match="vmdisk" mode="conv58to59">
49 <vmdisk>
50 <xsl:copy-of select="@*[not(local-name(.) = 'controller')]"/>
51 <xsl:choose>
52 <xsl:when test="@controller='scsi'">
53 <xsl:variable name="controllername" select='"lsilogic"'/>
54 <xsl:attribute name="controller">
55 <xsl:value-of select="$controllername"/>
56 </xsl:attribute>
57 </xsl:when>
58 <xsl:when test="@controller!='scsi'">
59 <xsl:variable name="controllername" select="@controller"/>
60 <xsl:attribute name="controller">
61 <xsl:value-of select="$controllername"/>
62 </xsl:attribute>
63 </xsl:when>
64 </xsl:choose>
65 <xsl:apply-templates mode="conv58to59"/>
66 </vmdisk>
67 </xsl:template>
68
69 </xsl:stylesheet>