| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE xsl:stylesheet [ |
| 3 |
<!ENTITY lowercase "'abcdefghijklmnopqrstuvwxyz'"> |
| 4 |
<!ENTITY uppercase "'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"> |
| 5 |
]> |
| 6 |
<xsl:stylesheet version="1.0" |
| 7 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
| 8 |
<xsl:output method="xml" |
| 9 |
indent="yes" omit-xml-declaration="no" encoding="utf-8"/> |
| 10 |
<xsl:strip-space elements="type"/> |
| 11 |
|
| 12 |
<!-- default rule --> |
| 13 |
<xsl:template match="*" mode="conv35to37"> |
| 14 |
<xsl:copy> |
| 15 |
<xsl:copy-of select="@*"/> |
| 16 |
<xsl:apply-templates mode="conv35to37"/> |
| 17 |
</xsl:copy> |
| 18 |
</xsl:template> |
| 19 |
|
| 20 |
<!-- version update --> |
| 21 |
<para xmlns="http://docbook.org/ns/docbook"> |
| 22 |
Changed attribute <tag class="attribute">schemaversion</tag> |
| 23 |
to <tag class="attribute">schemaversion</tag> from |
| 24 |
<literal>3.5</literal> to <literal>3.7</literal>. |
| 25 |
</para> |
| 26 |
<xsl:template match="image" mode="conv35to37"> |
| 27 |
<xsl:choose> |
| 28 |
<!-- nothing to do if already at 3.7 --> |
| 29 |
<xsl:when test="@schemaversion > 3.5"> |
| 30 |
<xsl:copy-of select="."/> |
| 31 |
</xsl:when> |
| 32 |
<!-- otherwise apply templates --> |
| 33 |
<xsl:otherwise> |
| 34 |
<image schemaversion="3.7"> |
| 35 |
<xsl:copy-of select="@*[local-name() != 'schemaversion']"/> |
| 36 |
<xsl:apply-templates mode="conv35to37"/> |
| 37 |
</image> |
| 38 |
</xsl:otherwise> |
| 39 |
</xsl:choose> |
| 40 |
</xsl:template> |
| 41 |
|
| 42 |
<!-- toplevel processing instructions and comments --> |
| 43 |
<xsl:template match="processing-instruction()|comment()" mode="conv35to37"> |
| 44 |
<xsl:copy> |
| 45 |
<xsl:copy-of select="@*"/> |
| 46 |
<xsl:apply-templates mode="conv35to37"/> |
| 47 |
</xsl:copy> |
| 48 |
</xsl:template> |
| 49 |
|
| 50 |
<!-- update bool types --> |
| 51 |
<para xmlns="http://docbook.org/ns/docbook"> |
| 52 |
Change possible mixed cases into lowercase and |
| 53 |
normalize any whitespaces |
| 54 |
</para> |
| 55 |
<xsl:template name="oem-change-content" mode="conv35to37"> |
| 56 |
<xsl:variable name="content" |
| 57 |
select="translate(normalize-space(.), &uppercase;, &lowercase;)" |
| 58 |
/> |
| 59 |
<xsl:copy> |
| 60 |
<xsl:copy-of select="@*"/><!-- Copy attributes --> |
| 61 |
<xsl:choose> |
| 62 |
<xsl:when test="$content = 'false'">false</xsl:when> |
| 63 |
<xsl:when test="$content = 'true'">true</xsl:when> |
| 64 |
<xsl:when test="$content = 'yes'">true</xsl:when> |
| 65 |
<xsl:when test="$content = 'no'">false</xsl:when> |
| 66 |
<xsl:otherwise> |
| 67 |
<!-- Should not happen --> |
| 68 |
<xsl:message>Wrong value!</xsl:message> |
| 69 |
</xsl:otherwise> |
| 70 |
</xsl:choose> |
| 71 |
</xsl:copy> |
| 72 |
</xsl:template> |
| 73 |
|
| 74 |
<xsl:template match="oem-swap" mode="conv35to37"> |
| 75 |
<xsl:call-template name="oem-change-content"/> |
| 76 |
</xsl:template> |
| 77 |
|
| 78 |
<xsl:template match="oem-home" mode="conv35to37"> |
| 79 |
<xsl:call-template name="oem-change-content"/> |
| 80 |
</xsl:template> |
| 81 |
|
| 82 |
<xsl:template match="rpm-check-signatures" mode="conv35to37"> |
| 83 |
<xsl:call-template name="oem-change-content"/> |
| 84 |
</xsl:template> |
| 85 |
|
| 86 |
<xsl:template match="rpm-excludedocs" mode="conv35to37"> |
| 87 |
<xsl:call-template name="oem-change-content"/> |
| 88 |
</xsl:template> |
| 89 |
|
| 90 |
<xsl:template match="rpm-force" mode="conv35to37"> |
| 91 |
<xsl:call-template name="oem-change-content"/> |
| 92 |
</xsl:template> |
| 93 |
|
| 94 |
<xsl:template match="oem-recovery" mode="conv35to37"> |
| 95 |
<xsl:call-template name="oem-change-content"/> |
| 96 |
</xsl:template> |
| 97 |
|
| 98 |
<xsl:template match="oem-kiwi-initrd" mode="conv35to37"> |
| 99 |
<xsl:call-template name="oem-change-content"/> |
| 100 |
</xsl:template> |
| 101 |
|
| 102 |
<xsl:template match="oem-sap-install" mode="conv35to37"> |
| 103 |
<xsl:call-template name="oem-change-content"/> |
| 104 |
</xsl:template> |
| 105 |
|
| 106 |
<xsl:template match="oem-reboot" mode="conv35to37"> |
| 107 |
<xsl:call-template name="oem-change-content"/> |
| 108 |
</xsl:template> |
| 109 |
|
| 110 |
</xsl:stylesheet> |