Skip to content

Commit

Permalink
Merge pull request #2646 from OSInside/xsl_comments
Browse files Browse the repository at this point in the history
Include PI and comments in XSL stylesheets
  • Loading branch information
Conan-Kudo authored Sep 17, 2024
2 parents 42e72d5 + 993f0dd commit 27517fe
Show file tree
Hide file tree
Showing 49 changed files with 423 additions and 48 deletions.
12 changes: 10 additions & 2 deletions helper/xsl_to_v74/convert14to20.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="conv14to20"/>
</xsl:copy>
</xsl:copy>
</xsl:template>

<!-- version update -->
Expand All @@ -22,7 +22,7 @@
<xsl:choose>
<!-- nothing to do if already at 2.0 -->
<xsl:when test="@schemeversion > 1.4 or @schemaversion > 1.4">
<xsl:copy-of select="/"/>
<xsl:copy-of select="."/>
</xsl:when>
<!-- otherwise apply templates -->
<xsl:otherwise>
Expand All @@ -34,6 +34,14 @@
</xsl:choose>
</xsl:template>

<!-- toplevel processing instructions and comments -->
<xsl:template match="processing-instruction()|comment()" mode="conv14to20">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="conv14to20"/>
</xsl:copy>
</xsl:template>

<!-- split section update -->
<para xmlns="http://docbook.org/ns/docbook">
Copy all attributes, when contents is NOT 'split'.
Expand Down
10 changes: 9 additions & 1 deletion helper/xsl_to_v74/convert20to24.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<xsl:choose>
<!-- nothing to do if already at 2.4 -->
<xsl:when test="@schemeversion > 2.0 or @schemaversion > 2.0">
<xsl:copy-of select="/"/>
<xsl:copy-of select="."/>
</xsl:when>
<!-- otherwise apply templates -->
<xsl:otherwise>
Expand All @@ -34,6 +34,14 @@
</xsl:choose>
</xsl:template>

<!-- toplevel processing instructions and comments -->
<xsl:template match="processing-instruction()|comment()" mode="conv20to24">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="conv20to24"/>
</xsl:copy>
</xsl:template>

<!-- remove attributes and add info -->
<para xmlns="http://docbook.org/ns/docbook">
Remove attributes memory,disk,HWversion,guestOS_32Bit and guestOS_64Bit
Expand Down
10 changes: 9 additions & 1 deletion helper/xsl_to_v74/convert24to35.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<xsl:choose>
<!-- nothing to do if already at 3.5 -->
<xsl:when test="@schemaversion > 2.4 or @schemeversion > 2.4">
<xsl:copy-of select="/"/>
<xsl:copy-of select="."/>
</xsl:when>
<!-- otherwise apply templates -->
<xsl:otherwise>
Expand All @@ -35,6 +35,14 @@
</xsl:choose>
</xsl:template>

<!-- toplevel processing instructions and comments -->
<xsl:template match="processing-instruction()|comment()" mode="conv24to35">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="conv24to35"/>
</xsl:copy>
</xsl:template>

<!-- remove compressed element -->
<para xmlns="http://docbook.org/ns/docbook">
Remove compressed element as it was moved into the type
Expand Down
10 changes: 9 additions & 1 deletion helper/xsl_to_v74/convert35to37.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<xsl:choose>
<!-- nothing to do if already at 3.7 -->
<xsl:when test="@schemaversion > 3.5">
<xsl:copy-of select="/"/>
<xsl:copy-of select="."/>
</xsl:when>
<!-- otherwise apply templates -->
<xsl:otherwise>
Expand All @@ -39,6 +39,14 @@
</xsl:choose>
</xsl:template>

<!-- toplevel processing instructions and comments -->
<xsl:template match="processing-instruction()|comment()" mode="conv35to37">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="conv35to37"/>
</xsl:copy>
</xsl:template>

<!-- update bool types -->
<para xmlns="http://docbook.org/ns/docbook">
Change possible mixed cases into lowercase and
Expand Down
10 changes: 9 additions & 1 deletion helper/xsl_to_v74/convert37to38.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<xsl:choose>
<!-- nothing to do if already at 3.8 -->
<xsl:when test="@schemaversion > 3.7">
<xsl:copy-of select="/"/>
<xsl:copy-of select="."/>
</xsl:when>
<!-- otherwise apply templates -->
<xsl:otherwise>
Expand All @@ -35,6 +35,14 @@
</xsl:choose>
</xsl:template>

<!-- toplevel processing instructions and comments -->
<xsl:template match="processing-instruction()|comment()" mode="conv37to38">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="conv37to38"/>
</xsl:copy>
</xsl:template>

<!-- update deploy / pxedeploy -->
<para xmlns="http://docbook.org/ns/docbook">
Change attribute value <tag class="attribute">deploy</tag> to
Expand Down
10 changes: 9 additions & 1 deletion helper/xsl_to_v74/convert38to39.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<xsl:choose>
<!-- nothing to do if already at 3.9 -->
<xsl:when test="@schemaversion > 3.8">
<xsl:copy-of select="/"/>
<xsl:copy-of select="."/>
</xsl:when>
<!-- otherwise apply templates -->
<xsl:otherwise>
Expand All @@ -35,6 +35,14 @@
</xsl:choose>
</xsl:template>

<!-- toplevel processing instructions and comments -->
<xsl:template match="processing-instruction()|comment()" mode="conv38to39">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="conv38to39"/>
</xsl:copy>
</xsl:template>

<!-- create new element oemconfig -->
<para xmlns="http://docbook.org/ns/docbook">
Create new <tag class="element">oemconfig</tag> element to collect
Expand Down
10 changes: 9 additions & 1 deletion helper/xsl_to_v74/convert39to41.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<xsl:choose>
<!-- nothing to do if already at 4.1 -->
<xsl:when test="@schemaversion > 3.9">
<xsl:copy-of select="/"/>
<xsl:copy-of select="."/>
</xsl:when>
<!-- otherwise apply templates -->
<xsl:otherwise>
Expand All @@ -37,6 +37,14 @@
</xsl:choose>
</xsl:template>

<!-- toplevel processing instructions and comments -->
<xsl:template match="processing-instruction()|comment()" mode="conv39to41">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="conv39to41"/>
</xsl:copy>
</xsl:template>

<xsl:template match="preferences" mode="conv39to41">
<preferences>
<xsl:copy-of select="@*"/>
Expand Down
10 changes: 9 additions & 1 deletion helper/xsl_to_v74/convert41to42.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<xsl:choose>
<!-- nothing to do if already at 4.2 -->
<xsl:when test="@schemaversion > 4.1">
<xsl:copy-of select="/"/>
<xsl:copy-of select="."/>
</xsl:when>
<!-- otherwise apply templates -->
<xsl:otherwise>
Expand All @@ -43,6 +43,14 @@
</xsl:choose>
</xsl:template>

<!-- toplevel processing instructions and comments -->
<xsl:template match="processing-instruction()|comment()" mode="conv41to42">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="conv41to42"/>
</xsl:copy>
</xsl:template>

<xsl:template match="preferences" mode="conv41to42">
<preferences>
<xsl:copy-of select="@*"/>
Expand Down
10 changes: 9 additions & 1 deletion helper/xsl_to_v74/convert42to43.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<xsl:choose>
<!-- nothing to do if already at 4.3 -->
<xsl:when test="@schemaversion > 4.2">
<xsl:copy-of select="/"/>
<xsl:copy-of select="."/>
</xsl:when>
<!-- otherwise apply templates -->
<xsl:otherwise>
Expand All @@ -37,6 +37,14 @@
</xsl:choose>
</xsl:template>

<!-- toplevel processing instructions and comments -->
<xsl:template match="processing-instruction()|comment()" mode="conv42to43">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="conv42to43"/>
</xsl:copy>
</xsl:template>

<xsl:template match="preferences" mode="conv42to43">
<preferences>
<xsl:copy-of select="@*"/>
Expand Down
10 changes: 9 additions & 1 deletion helper/xsl_to_v74/convert43to44.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<xsl:choose>
<!-- nothing to do if already at 4.4 -->
<xsl:when test="@schemaversion > 4.3">
<xsl:copy-of select="/"/>
<xsl:copy-of select="."/>
</xsl:when>
<!-- otherwise apply templates -->
<xsl:otherwise>
Expand All @@ -35,6 +35,14 @@
</xsl:choose>
</xsl:template>

<!-- toplevel processing instructions and comments -->
<xsl:template match="processing-instruction()|comment()" mode="conv43to44">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="conv43to44"/>
</xsl:copy>
</xsl:template>

<!-- remove commandline element -->
<para xmlns="http://docbook.org/ns/docbook">
Remove compressed element as it was moved into the type
Expand Down
10 changes: 9 additions & 1 deletion helper/xsl_to_v74/convert44to45.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<xsl:choose>
<!-- nothing to do if already at 4.5 -->
<xsl:when test="@schemaversion > 4.4">
<xsl:copy-of select="/"/>
<xsl:copy-of select="."/>
</xsl:when>
<!-- otherwise apply templates -->
<xsl:otherwise>
Expand All @@ -35,6 +35,14 @@
</xsl:choose>
</xsl:template>

<!-- toplevel processing instructions and comments -->
<xsl:template match="processing-instruction()|comment()" mode="conv44to45">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="conv44to45"/>
</xsl:copy>
</xsl:template>

<!-- remove patternPackageType attribute -->
<para xmlns="http://docbook.org/ns/docbook">
Remove patternPackageType attribute, it's no longer used
Expand Down
10 changes: 9 additions & 1 deletion helper/xsl_to_v74/convert45to46.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<xsl:choose>
<!-- nothing to do if already at 4.6 -->
<xsl:when test="@schemaversion > 4.5">
<xsl:copy-of select="/"/>
<xsl:copy-of select="."/>
</xsl:when>
<!-- otherwise apply templates -->
<xsl:otherwise>
Expand All @@ -35,6 +35,14 @@
</xsl:choose>
</xsl:template>

<!-- toplevel processing instructions and comments -->
<xsl:template match="processing-instruction()|comment()" mode="conv45to46">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="conv45to46"/>
</xsl:copy>
</xsl:template>

<!-- update vmware / vmx -->
<para xmlns="http://docbook.org/ns/docbook">
Change attribute value <tag class="attribute">vmware</tag> to
Expand Down
10 changes: 9 additions & 1 deletion helper/xsl_to_v74/convert46to47.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<xsl:choose>
<!-- nothing to do if already at 4.7 -->
<xsl:when test="@schemaversion > 4.6">
<xsl:copy-of select="/"/>
<xsl:copy-of select="."/>
</xsl:when>
<!-- otherwise apply templates -->
<xsl:otherwise>
Expand All @@ -35,6 +35,14 @@
</xsl:choose>
</xsl:template>

<!-- toplevel processing instructions and comments -->
<xsl:template match="processing-instruction()|comment()" mode="conv46to47">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="conv46to47"/>
</xsl:copy>
</xsl:template>

<!-- turn vmwareconfig into machine, ignore usb attribute -->
<xsl:template match="vmwareconfig" mode="conv46to47">
<machine>
Expand Down
10 changes: 9 additions & 1 deletion helper/xsl_to_v74/convert47to48.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<xsl:choose>
<!-- nothing to do if already at 4.8 -->
<xsl:when test="@schemaversion > 4.7">
<xsl:copy-of select="/"/>
<xsl:copy-of select="."/>
</xsl:when>
<!-- otherwise apply templates -->
<xsl:otherwise>
Expand All @@ -59,6 +59,14 @@
</xsl:choose>
</xsl:template>

<!-- toplevel processing instructions and comments -->
<xsl:template match="processing-instruction()|comment()" mode="conv47to48">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="conv47to48"/>
</xsl:copy>
</xsl:template>

<!-- remove lvm attribute, call add-systemdisk if no lvmvolumes exists and
either lvm is enabled or oem-home exists and set to true in oemconfig
if lvmvolumes exists and there is oem-home enabled too, add a home
Expand Down
10 changes: 9 additions & 1 deletion helper/xsl_to_v74/convert48to49.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<xsl:choose>
<!-- nothing to do if already at 4.9 -->
<xsl:when test="@schemaversion > 4.8">
<xsl:copy-of select="/"/>
<xsl:copy-of select="."/>
</xsl:when>
<!-- otherwise apply templates -->
<xsl:otherwise>
Expand All @@ -39,6 +39,14 @@
</xsl:choose>
</xsl:template>

<!-- toplevel processing instructions and comments -->
<xsl:template match="processing-instruction()|comment()" mode="conv48to49">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="conv48to49"/>
</xsl:copy>
</xsl:template>

<!-- transform oem-dumphalt to oem-bootwait -->
<xsl:template match="oemconfig/oem-dumphalt" mode="conv48to49">
<oem-bootwait><xsl:value-of select="text()"/></oem-bootwait>
Expand Down
10 changes: 9 additions & 1 deletion helper/xsl_to_v74/convert49to50.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<xsl:choose>
<!-- nothing to do if already at 5.0 -->
<xsl:when test="@schemaversion > 4.9">
<xsl:copy-of select="/"/>
<xsl:copy-of select="."/>
</xsl:when>
<!-- otherwise apply templates -->
<xsl:otherwise>
Expand All @@ -33,6 +33,14 @@
</xsl:choose>
</xsl:template>

<!-- toplevel processing instructions and comments -->
<xsl:template match="processing-instruction()|comment()" mode="conv49to50">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="conv49to50"/>
</xsl:copy>
</xsl:template>

<!-- convert xen image type to vmx -->
<xsl:template match="type" mode="conv49to50">
<type>
Expand Down
Loading

0 comments on commit 27517fe

Please sign in to comment.