GNOME Bugzilla – Bug 120039
Error messages when validating RelaxNG docs are unhelpful
Last modified: 2021-07-05 13:26:38 UTC
When using xmllint to validate some XML documents against a RelaxNG schema, it produces some misleading error messages. Here is some output: $ xmllint --noout --relaxng ../DTD/navigation.rng global-navigation.xml RNG validity error Extra element item in interleave RNG validity error: file global-navigation.xml line 5 element item Element bar failed to validate content global-navigation.xml fails to validate $ I can't figure out what the above means. I grabbed a copy of Jing, and it reports: $ jing ../DTD/navigation.rng global-navigation.xml /home/gleblanc/projects/gnome-web/www.gnome.org/global-navigation.xml:5: error: required attributes missing ... $ Which seems pretty straightforward. xmllint should provide a similarly helpful error message.
Without schemas and xml I can't even reproduce this. Moreover you can perfectly have <choice> <element name="foo"> <attribute name="bar"> <text/> </element> <element name="foo"> <data type="date"/> </element> </choice> i.e. the fact that an attribute may be missing cannot be reported as the problem in case you have a choice. You may have for example foo without attribute and a mathcing element content, the error would be somewhere else... So in general this is not applicable. And without any idea of your schemas the bug report is simply useless ! Daniel
Created attachment 19272 [details] RelaxNG Schema
Created attachment 19273 [details] XML document
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxml2/-/issues/ Thank you for your understanding and your help.