Debian Codegraph @

helper/xsl_to_v74/convert71to72.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="conv71to72">
8 <xsl:copy>
9 <xsl:copy-of select="@*"/>
10 <xsl:apply-templates mode="conv71to72"/>
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.1</literal> to <literal>7.2</literal>.
19 </para>
20 <xsl:template match="image" mode="conv71to72">
21 <xsl:choose>
22 <!-- nothing to do if already at 7.2 -->
23 <xsl:when test="@schemaversion > 7.1">
24 <xsl:copy-of select="."/>
25 </xsl:when>
26 <!-- otherwise apply templates -->
27 <xsl:otherwise>
28 <image schemaversion="7.2">
29 <xsl:copy-of select="@*[local-name() != 'schemaversion']"/>
30 <xsl:apply-templates mode="conv71to72"/>
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="conv71to72">
38 <xsl:copy>
39 <xsl:copy-of select="@*"/>
40 <xsl:apply-templates mode="conv71to72"/>
41 </xsl:copy>
42 </xsl:template>
43
44 <para xmlns="http://docbook.org/ns/docbook">
45 Move bootloader, bootloader_console, boottimeout
46 and zipl_targettype attributes from types into a new
47 bootloader subsection
48 </para>
49 <xsl:template match="type" mode="conv71to72">
50 <type>
51 <xsl:copy-of select="@*[not(local-name(.) = 'bootloader') and not(local-name(.) = 'bootloader_console') and not(local-name(.) = 'boottimeout') and not(local-name(.) = 'zipl_targettype')]"/>
52 <xsl:variable name="loadername" select="@bootloader"/>
53 <xsl:variable name="loaderconsole" select="@bootloader_console"/>
54 <xsl:variable name="loadertime" select="@boottimeout"/>
55 <xsl:variable name="loadertarget" select="@zipl_targettype"/>
56 <xsl:choose>
57 <xsl:when test="@bootloader!=''">
58 <bootloader>
59 <xsl:attribute name="name">
60 <xsl:value-of select="$loadername"/>
61 </xsl:attribute>
62 <xsl:choose>
63 <xsl:when test="@bootloader_console!=''">
64 <xsl:attribute name="console">
65 <xsl:value-of select="$loaderconsole"/>
66 </xsl:attribute>
67 </xsl:when>
68 </xsl:choose>
69 <xsl:choose>
70 <xsl:when test="@boottimeout!=''">
71 <xsl:attribute name="timeout">
72 <xsl:value-of select="$loadertime"/>
73 </xsl:attribute>
74 </xsl:when>
75 </xsl:choose>
76 <xsl:choose>
77 <xsl:when test="@zipl_targettype!=''">
78 <xsl:attribute name="targettype">
79 <xsl:value-of select="$loadertarget"/>
80 </xsl:attribute>
81 </xsl:when>
82 </xsl:choose>
83 </bootloader>
84 </xsl:when>
85 </xsl:choose>
86 <xsl:apply-templates mode="conv71to72"/>
87 </type>
88 </xsl:template>
89
90 </xsl:stylesheet>