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

Martin Kletzander mkletzan at redhat.com
Thu Mar 30 18:23:32 UTC 2017


On Thu, Mar 30, 2017 at 03:45:27PM +0200, Andrea Bolognani wrote:
>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.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>
>

I think this defeats the purpose of the template.  But on the other hand
you can see how the change looks like in previous releases and git
history etc.

>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>

Instead of this, you can use zeroOrMore.

ACK series, with that changed if you are okay with the fact that I know
XSL even less than RNG O=)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170330/cac9f659/attachment-0001.sig>


More information about the libvir-list mailing list