Debian Codegraph @

helper/xsl_to_v74/convert63to64.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="conv63to64">
8 <xsl:copy>
9 <xsl:copy-of select="@*"/>
10 <xsl:apply-templates mode="conv63to64"/>
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>6.3</literal> to <literal>6.4</literal>.
19 </para>
20 <xsl:template match="image" mode="conv63to64">
21 <xsl:choose>
22 <!-- nothing to do if already at 6.4 -->
23 <xsl:when test="@schemaversion > 6.3">
24 <xsl:copy-of select="."/>
25 </xsl:when>
26 <!-- otherwise apply templates -->
27 <xsl:otherwise>
28 <image schemaversion="6.4">
29 <xsl:copy-of select="@*[local-name() != 'schemaversion']"/>
30 <xsl:apply-templates mode="conv63to64"/>
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="conv63to64">
38 <xsl:copy>
39 <xsl:copy-of select="@*"/>
40 <xsl:apply-templates mode="conv63to64"/>
41 </xsl:copy>
42 </xsl:template>
43
44 <para xmlns="http://docbook.org/ns/docbook">
45 Remove obsolete group and id attribute from users
46 </para>
47 <xsl:template match="users" mode="conv63to64">
48 <users>
49 <xsl:copy-of select="@*[not(local-name(.) = 'group') and not(local-name(.) = 'id')]"/>
50 <xsl:apply-templates mode="conv63to64"/>
51 </users>
52 </xsl:template>
53
54 <para xmlns="http://docbook.org/ns/docbook">
55 Move global group attribute as groups to user section(s)
56 </para>
57 <xsl:template match="user" mode="conv63to64">
58 <user>
59 <xsl:variable name="group_name" select="../@group"/>
60 <xsl:copy-of select="@*"/>
61 <xsl:if test="$group_name">
62 <xsl:attribute name="groups">
63 <xsl:value-of select="$group_name"/>
64 </xsl:attribute>
65 </xsl:if>
66 <xsl:apply-templates mode="conv63to64"/>
67 </user>
68 </xsl:template>
69
70 </xsl:stylesheet>