GNOME Bugzilla – Bug 623971
gtkdoc-mkhtml should terminate on errors
Last modified: 2011-03-29 14:32:40 UTC
gtkdoc-mkhtml may encounter parsing errors in the input xml files: parser error : Opening and ending tag mismatch: para line 57 and refsect1 ... parser error : Premature end of data in tag refentry line 9 ... element include: XInclude error : could not load /home/bjourne/gtkimageview/build/default/src/xml/gtkanimview.xml, and no fallback was found These errors are critical and will result in broken gtkdoc documentation with missing pages. gtkdoc-mkhtml should terminate when an error like the above is discovered. It should also return a non-zero exit code.
in gtkdoc-mkhtml we pass the xsltproc return-code up @XSLTPROC@ $path_arg --nonet --xinclude \ --stringparam gtkdoc.bookname $module \ --stringparam gtkdoc.version "@VERSION@" \ "$@" $gtkdocdir/gtk-doc.xsl $document || exit $? and also in gtkdoc.make we don't ignore the return code. Need to check the actual return-value from xsltproc in the above case ...
I found no option in xsltproc to make parser errors fatal :/ gtk-doc/tests/bugs/docs/html$ /usr/bin/xsltproc --path /home/ensonic/projects/gnome/gtk-doc/tests/bugs/docs --nonet --xinclude --stringparam gtkdoc.bookname tester --stringparam gtkdoc.version 1.15.1 /home/ensonic/projects/gnome/gtk-doc/gtk-doc.xsl ../tester-docs.xml; echo $? ../xml/tester.xml:591: parser error : Opening and ending tag mismatch: para line 578 and refsect2 </variablelist></refsect2> ^ ../xml/tester.xml:593: parser error : Opening and ending tag mismatch: refsect2 line 574 and refsect1 </refsect1> ^ ../xml/tester.xml:595: parser error : Opening and ending tag mismatch: refsect1 line 90 and refentry </refentry> ^ ../xml/tester.xml:596: parser error : Premature end of data in tag refentry line 7 ^ ../tester-docs.xml:19: element include: XInclude error : could not load ../xml/tester.xml, and no fallback was found Computing chunks... Element include in namespace 'http://www.w3.org/2003/XInclude' encountered in chapter, but no template matches. Writing ch01.html for chapter Writing api-index.html for index(api-index) Writing deprecated-api-index.html for index(deprecated-api-index) Writing index.html for book(index) Writing index.sgml for book(index) Writing tester.devhelp for book(index) Writing tester.devhelp2 for book(index) 0 It could be 'fixed' by running xmllint --noout --xinclude ../tester-docs.xml; echo $? after gtkdoc-mkdb but that would cause even more slowdown. I'd prefer to have this fixed in xsltproc (extra option). Björn, any opinion? Move as a feature request to libxslt?
I think the return code issue more important than getting xsltproc to halt correctly. But for me, it returns zero even on parse errors: $ /usr/bin/xsltproc --nonet --xinclude --stringparam gtkdoc.bookname gtkimageview --stringparam gtkdoc.version 1.14 /usr/share/gtk-doc/data/gtk-doc.xsl /home/bjourne/gtkimageview/build/default/src/gtkimageview.sgml parser error : Opening and ending tag mismatch: para line 65 and refsect1 ... $ echo $? 0 So I guess everything is xsltproc's fault. :) Though I definitely wouldn't mind an option to run xmllint and catch these errors. I'd use it.
That's what I meant. xmllint would error out correctly. xsltproc does not. I filed a bug for libxslt.
xsltproc does actually now error out. See dependent bug. Closing this one.