After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 692865 - Invalid docbook generated by gdbus-codegen
Invalid docbook generated by gdbus-codegen
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gdbus
unspecified
Other Linux
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-01-30 09:54 UTC by Stef Walter
Modified: 2013-01-31 09:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test interface definition (1.37 KB, application/xml)
2013-01-30 10:12 UTC, Stef Walter
  Details
Invalid docbook output (4.27 KB, application/xml)
2013-01-30 10:13 UTC, Stef Walter
  Details
gdbus: Don't output invalid empty <variablelist> tags (4.12 KB, patch)
2013-01-30 10:14 UTC, Stef Walter
committed Details | Review
gdbus: Don't output invalid nested <para> docbook tags (4.64 KB, patch)
2013-01-30 10:15 UTC, Stef Walter
committed Details | Review

Description Stef Walter 2013-01-30 09:54:30 UTC
gdbus-codegen generates invalid docbook in two cases:

 * Nested <para> tags.
 * Empty <variablelist> elements.

Attached is a sample interface, and teh docbook output. To process use:

$ gdbus-codegen --generate-docbook test org.gtk.TestDocbook.xml
$ xmlto html-nochunks test-org.gtk.TestDocbook.xml

You'll see the following errors:

xmlto: /data/Desktop/test-org.gtk.TestDocbook.xml does not validate (status 3)
xmlto: Fix document syntax or use --skip-validation option
/data/Desktop/test-org.gtk.TestDocbook.xml:16: element para: validity error : Element para is not declared in para list of possible children
/data/Desktop/test-org.gtk.TestDocbook.xml:16: element para: validity error : Element para is not declared in para list of possible children
/data/Desktop/test-org.gtk.TestDocbook.xml:35: element para: validity error : Element para is not declared in para list of possible children
/data/Desktop/test-org.gtk.TestDocbook.xml:37: element variablelist: validity error : Element variablelist content does not follow the DTD, expecting ((title , titleabbrev?)? , varlistentry+), got ()
Document /data/Desktop/test-org.gtk.TestDocbook.xml does not validate
Comment 1 Stef Walter 2013-01-30 10:12:57 UTC
Created attachment 234812 [details]
Test interface definition
Comment 2 Stef Walter 2013-01-30 10:13:20 UTC
Created attachment 234813 [details]
Invalid docbook output
Comment 3 Stef Walter 2013-01-30 10:14:58 UTC
Created attachment 234814 [details] [review]
gdbus: Don't output invalid empty <variablelist> tags

Docbook doesn't allow an empty <variablelist> and so the docbook
output from gdbus-codegen is invalid when a method/signal has
no arguments.
Comment 4 Stef Walter 2013-01-30 10:15:03 UTC
Created attachment 234815 [details] [review]
gdbus: Don't output invalid nested <para> docbook tags

Fix gdbus-codegen so it no longer outputs tags like
<para><para>Text</para></para>
Comment 5 Stef Walter 2013-01-30 10:16:49 UTC
FWIW, realmd works around these bugs by including its own fixer-upper XSL:

http://cgit.freedesktop.org/realmd/realmd/tree/doc/manual/gdbus-fix-bugs.xsl

FWIW, because this hasn't been caught before, I'm assuming that gtk-doc doesn't strictly validate the docbook input, and so doesn't barf on this.
Comment 6 Matthias Clasen 2013-01-30 23:27:16 UTC
Review of attachment 234814 [details] [review]:

looks good to me
Comment 7 Matthias Clasen 2013-01-30 23:29:39 UTC
Review of attachment 234815 [details] [review]:

looks good
Comment 8 Matthias Clasen 2013-01-30 23:29:58 UTC
Review of attachment 234815 [details] [review]:

looks good
Comment 9 Stef Walter 2013-01-31 09:04:33 UTC
Thanks for the review. Pushed to git master.

Attachment 234814 [details] pushed as 11e208f - gdbus: Don't output invalid empty <variablelist> tags
Attachment 234815 [details] pushed as 3202978 - gdbus: Don't output invalid nested <para> docbook tags