GNOME Bugzilla – Bug 789703
xmllint validation against ods relaxng spec fails
Last modified: 2021-07-05 13:25:24 UTC
cad102b861f74d56e3f6e710c466cf1a38a5db56 broke validation of spreadsheets against the ODS relaxng spec. Start by getting the spec: # wget http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-ext-schema.rng [...] # sha1sum OpenDocument-v1.2-os-schema.rng adc746cbb415ac3a17199442a15b38a5858fc7ef OpenDocument-v1.2-os-schema.rng This contains the fragment <define name="namespacedToken"> <data type="QName"> <param name="pattern">[^:]+:[^:]+</param> </data> </define> which used to match names like "gnm:spinbutton", but after the above commit does not. The regexp match is done only on the "spinbutton" part, so no match. I don't know if the ods relaxng spec is wrong or if xmllint is at fault. The error message from xmllint is misleading. That's common with relaxng validation: # xmllint --noout --relaxng ods-schema/OpenDocument-v1.2-os-ext-schema.rng ~/c-save.xml /home/welinder/c-save.xml:10: element forms: Relax-NG validity error : Expecting element table-column-group, got forms /home/welinder/c-save.xml:10: element forms: Relax-NG validity error : Did not expect element forms there /home/welinder/c-save.xml:10: element forms: Relax-NG validity error : Expecting element table-header-columns, got forms /home/welinder/c-save.xml:10: element forms: Relax-NG validity error : Element table failed to validate content /home/welinder/c-save.xml fails to validate The document in question follows. This is a reduced document for the purpose of this bug report, not a meaningful spreadsheet file. <?xml version="1.0" encoding="UTF-8"?> <office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gnm="http://www.gnumeric.org/odf-extension/1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" office:version="1.2"> <office:scripts/> <office:font-face-decls/> <office:automatic-styles/> <office:body> <office:spreadsheet> <table:table table:name="Sheet1" table:style-name="ta-0" table:print="true"> <office:forms form:automatic-focus="false" form:apply-design-mode="false"> <form:form> <form:value-range form:control-implementation="gnm:spinbutton" xml:id="CTRL0000" form:id="CTRL0000"/> </form:form> </office:forms> <table:table-column table:default-cell-style-name="ACE-0" table:style-name="ACOL-0"/> <table:table-row table:style-name="AROW-0"> </table:table-row> </table:table> </office:spreadsheet> </office:body> </office:document-content>
I note that I pasted the wrong xmllint command line. The right one produces the same result. xmllint --noout --relaxng OpenDocument-v1.2-os-schema.rng c-save.xml
Ping? It would be useful just to have an acknowledgment that this is indeed a libxml2 problem as opposed to a bug in the ods spec.
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.