[PATCH 2/2] news: Allow empty <section> elements

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

 



Creating dummy <change> elements was a workaround for the
HTML DTD not allowing empty <ul> elements, but we can do
better by tweaking the the XSLT stylesheet.
---
 docs/news-html.xsl    |  8 +++++---
 docs/news.xml         |  9 ---------
 docs/schemas/news.rng | 17 ++++++++---------
 3 files changed, 13 insertions(+), 21 deletions(-)

diff --git a/docs/news-html.xsl b/docs/news-html.xsl
index dcbab86..dd323f9 100644
--- a/docs/news-html.xsl
+++ b/docs/news-html.xsl
@@ -57,9 +57,11 @@
       <strong>
         <xsl:value-of select="@title"/>
       </strong>
-      <ul>
-        <xsl:apply-templates select="change"/>
-      </ul>
+      <xsl:if test="*">
+        <ul>
+          <xsl:apply-templates select="change"/>
+        </ul>
+      </xsl:if>
     </li>
   </xsl:template>
 
diff --git a/docs/news.xml b/docs/news.xml
index 9eb4d21..732d359 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -23,19 +23,10 @@
 
   <release version="FIXME" date="unreleased">
     <section title="New features">
-      <change>
-        <summary/>
-      </change>
     </section>
     <section title="Improvements">
-      <change>
-        <summary/>
-      </change>
     </section>
     <section title="Bug fixes">
-      <change>
-        <summary/>
-      </change>
     </section>
   </release>
 
diff --git a/docs/schemas/news.rng b/docs/schemas/news.rng
index 94a6870..9212c3c 100644
--- a/docs/schemas/news.rng
+++ b/docs/schemas/news.rng
@@ -35,21 +35,20 @@
       <attribute name="title">
         <data type="string"/>
       </attribute>
-      <oneOrMore>
-        <ref name="change"/>
-      </oneOrMore>
+      <optional>
+        <oneOrMore>
+          <ref name="change"/>
+        </oneOrMore>
+      </optional>
     </element>
   </define>
 
   <define name="change">
     <element name="change">
       <element name="summary">
-        <choice>
-          <data type="string">
-            <param name="pattern">\n[^\n]+\n +</param>
-          </data>
-          <empty/>
-        </choice>
+        <data type="string">
+          <param name="pattern">\n[^\n]+\n +</param>
+        </data>
       </element>
       <optional>
         <element name="description">
-- 
2.7.4

--
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]
  Powered by Linux