GNOME Bugzilla – Bug 692865
Invalid docbook generated by gdbus-codegen
Last modified: 2013-01-31 09:04:39 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
Created attachment 234812 [details] Test interface definition
Created attachment 234813 [details] Invalid docbook output
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.
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>
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.
Review of attachment 234814 [details] [review]: looks good to me
Review of attachment 234815 [details] [review]: looks good
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