doc/xsl: fix malformed <variablelist>

For all requests and events that do not have any arguments, enabling XML
validation would lead to many errors like this:

/home/pq/git/wayland/build/doc/publican/Wayland.xml:5287: element
variablelist: validity error : Element variablelist content does not
follow the DTD, expecting (blockinfo? , (title , titleabbrev?)? ,
(caution | important | note | tip | warning | literallayout |
programlisting | programlistingco | screen | screenco | screenshot |
synopsis | cmdsynopsis | funcsynopsis | classsynopsis | fieldsynopsis |
constructorsynopsis | destructorsynopsis | methodsynopsis | formalpara |
para | simpara | address | blockquote | graphic | graphicco |
mediaobject | mediaobjectco | informalequation | informalexample |
informalfigure | informaltable | anchor | bridgehead | remark |
highlights | abstract | authorblurb | epigraph | indexterm | beginpage)*
, varlistentry+), got

The reason is that a <variablelist> without any <varlistentry> inside it
is illegal.

If there are no <arg> at all, do not emit the list paragraph.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
This commit is contained in:
Pekka Paalanen 2025-12-27 21:07:06 +02:00
parent 0519f2fbf8
commit 573c95cb1a

View file

@ -186,11 +186,13 @@
- <xsl:value-of select="description/@summary" />
</xsl:if>
</title>
<para>
<variablelist>
<xsl:apply-templates select="arg"/>
</variablelist>
</para>
<xsl:if test="arg">
<para>
<variablelist>
<xsl:apply-templates select="arg"/>
</variablelist>
</para>
</xsl:if>
<xsl:call-template name="break">
<xsl:with-param name="text" select="description" />
</xsl:call-template>