Relaxng validation for ods speadsheets broken
Resurrecting bugzilla 789703 which seems to have been missed and was never migrated.
Commit cad102b8 broke validation of ods preadsheets against the ODS relaxng spec.
To see this, first get the spec:
wget http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-schema.rng
# sha1sum OpenDocument-v1.2-os-schema.rng
adc746cbb415ac3a17199442a15b38a5858fc7ef OpenDocument-v1.2-os-schema.rng
foo.xml This file 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 --version
xmllint: using libxml version 20910
compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv ICU ISO8859X Unicode Regexps Automata Schemas Schematron Modules Debug Zlib Lzma
# xmllint --noout --relaxng ods-schema/OpenDocument-v1.2-os-schema.rng ~/foo.xml
/home/welinder/foo.xml:10: element forms: Relax-NG validity error : Expecting element table-column-group, got forms
/home/welinder/foo.xml:10: element forms: Relax-NG validity error : Did not expect element forms there
/home/welinder/foo.xml:10: element forms: Relax-NG validity error : Expecting element table-header-columns, got forms
/home/welinder/foo.xml:10: element forms: Relax-NG validity error : Element table failed to validate content
/home/welinder/foo.xml fails to validate
Note, that foo.xml is a reduced document for the purpose of this bug report, not a meaningful spreadsheet file.