Debian Codegraph @

helper/xsl_to_v74/convert51to52.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="conv51to52">
8 <xsl:copy>
9 <xsl:copy-of select="@*"/>
10 <xsl:apply-templates mode="conv51to52"/>
11 </xsl:copy>
12 </xsl:template>
13
14 <!-- version update -->
15 <!-- remove inherit attribute from image -->
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>5.1</literal> to <literal>5.2</literal>.
20 </para>
21 <xsl:template match="image" mode="conv51to52">
22 <xsl:choose>
23 <!-- nothing to do if already at 5.2 -->
24 <xsl:when test="@schemaversion > 5.1">
25 <xsl:copy-of select="."/>
26 </xsl:when>
27 <!-- otherwise apply templates -->
28 <xsl:otherwise>
29 <image schemaversion="5.2">
30 <xsl:copy-of select="@*[local-name() != 'schemaversion' and local-name() != 'inherit']"/>
31 <xsl:apply-templates mode="conv51to52"/>
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="conv51to52">
39 <xsl:copy>
40 <xsl:copy-of select="@*"/>
41 <xsl:apply-templates mode="conv51to52"/>
42 </xsl:copy>
43 </xsl:template>
44
45 <!-- remove obsolete usb image type -->
46 <xsl:template match="type" mode="conv51to52">
47 <xsl:choose>
48 <xsl:when test="@image!='usb'">
49 <type>
50 <xsl:copy-of select="@*"/>
51 <xsl:apply-templates mode="conv51to52"/>
52 </type>
53 </xsl:when>
54 </xsl:choose>
55 </xsl:template>
56
57 </xsl:stylesheet>