Re: [PATCH 01/15] NEWS: Fix XSLT stylesheet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 14, 2015 at 10:35:57AM +0200, Andrea Bolognani wrote:
This has been broken for a looong time - in fact, we've been
shipping a mostly-empty NEWS file for at least the past two years.

Including the html namespace and using it for matching elements,
like hacking1.xsl and hacking2.xsl were already doing, makes the
NEWS file useful again.
---
docs/news.xsl | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/docs/news.xsl b/docs/news.xsl
index e35030e..f05d7a1 100644
--- a/docs/news.xsl
+++ b/docs/news.xsl
@@ -1,6 +1,7 @@
<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
-                version="1.0">
+<xsl:stylesheet version="1.0"
+                xmlns:html="http://www.w3.org/1999/xhtml";
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  <xsl:output method="text" encoding="UTF-8"/>

  <xsl:template match="/">
@@ -11,29 +12,34 @@
       http://libvirt.org/news.html

</xsl:text>
-    <xsl:apply-templates select="html/body/*"/>
+    <xsl:apply-templates select="html:html/html:body/*"/>
  </xsl:template>
-  <xsl:template match="h1"/>

-  <xsl:template match="h3">
+  <xsl:template match="html:h1"/>
+  <xsl:template match="html:p"/>
+
+  <xsl:template match="html:h3">
    <xsl:text>
</xsl:text>
    <xsl:apply-templates/>
    <xsl:text>:
</xsl:text>
  </xsl:template>
-  <xsl:template match="ul">
-    <xsl:apply-templates select=".//li"/>
+
+  <xsl:template match="html:ul">
+      <xsl:apply-templates select="html:li"/>
    <xsl:text>
</xsl:text>
  </xsl:template>
-  <xsl:template match="li">
+
+  <xsl:template match="html:li">
    <xsl:text>   - </xsl:text>
    <xsl:value-of select="."/>
    <xsl:text>
</xsl:text>
  </xsl:template>
-  <xsl:template match="a">
+
+  <xsl:template match="html:a">
    <xsl:value-of select="."/>
    <xsl:text> at
</xsl:text>
@@ -41,6 +47,5 @@
    <xsl:text>
</xsl:text>
  </xsl:template>
-  <xsl:template match="p">
-  </xsl:template>
+

I'm assuming this is not needed after all following patches are
applied and that's fine, but leads me to a question whether we could
move this patch at the end of the series, so that we first fix all the
horrible things in news.html.in and then fix the transformation code.
Even better if we could split the news.html.in into new and old ones
(as discussed) and then apply this patch after that so that we don't
generate over megabyte of data.  Of course it's enough to have it in
throughout the rest of the month, but using this particular order
make sure we won't leave it unnoticed for bunch of other releases.

Having said that, I don't really care that much about one 3½" floppy
disk of data added to the tarball as it adds almost no size when
compressed, but it would just be nicer, I think, when it's not all
there, especially when nobody reads the news =)

Anyway ACK from the technical POV.

</xsl:stylesheet>
--
2.4.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]