After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730397 - Invalid ods produced
Invalid ods produced
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: import/export OOo / OASIS
git master
Other All
: Normal normal
: ---
Assigned To: Andreas J. Guelzow
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2014-05-19 18:38 UTC by Morten Welinder
Modified: 2014-05-20 01:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Morten Welinder 2014-05-19 18:38:51 UTC
With soon-to-be-updated t6150:

Checking ../samples/excel/chart-tests-excel.xls
While checking Graph13/content.xml from chart-tests-excel.ods:
| -:150: element categories: Relax-NG validity error : Did not expect element categories there
| - fails to validate
While checking Graph14/content.xml from chart-tests-excel.ods:
| -:150: element categories: Relax-NG validity error : Did not expect element categories there
| - fails to validate
While checking Graph15/content.xml from chart-tests-excel.ods:
| -:150: element categories: Relax-NG validity error : Did not expect element categories there
| - fails to validate
While checking Graph16/content.xml from chart-tests-excel.ods:
| -:150: element categories: Relax-NG validity error : Did not expect element categories there
| - fails to validate
While checking Graph17/content.xml from chart-tests-excel.ods:
| -:150: element categories: Relax-NG validity error : Did not expect element categories there
| - fails to validate
While checking Graph18/content.xml from chart-tests-excel.ods:
| -:150: element categories: Relax-NG validity error : Did not expect element categories there
| - fails to validate
While checking Graph19/content.xml from chart-tests-excel.ods:
| -:115: element subtitle: Relax-NG validity error : Invalid attribute cell-address for element subtitle
| - fails to validate
While checking Graph2/content.xml from chart-tests-excel.ods:
| -:137: element categories: Relax-NG validity error : Did not expect element categories there
| - fails to validate
While checking Graph20/content.xml from chart-tests-excel.ods:
| -:115: element subtitle: Relax-NG validity error : Invalid attribute cell-address for element subtitle
| - fails to validate
While checking Graph21/content.xml from chart-tests-excel.ods:
| -:121: element subtitle: Relax-NG validity error : Invalid attribute cell-address for element subtitle
| - fails to validate
While checking Graph22/content.xml from chart-tests-excel.ods:
| -:121: element subtitle: Relax-NG validity error : Invalid attribute cell-address for element subtitle
| - fails to validate
While checking Graph24/content.xml from chart-tests-excel.ods:
| -:127: element subtitle: Relax-NG validity error : Invalid attribute cell-address for element subtitle
| - fails to validate
While checking Graph25/content.xml from chart-tests-excel.ods:
| -:145: element subtitle: Relax-NG validity error : Invalid attribute cell-address for element subtitle
| - fails to validate
While checking Graph26/content.xml from chart-tests-excel.ods:
| -:139: element subtitle: Relax-NG validity error : Invalid attribute cell-address for element subtitle
| - fails to validate
While checking Graph27/content.xml from chart-tests-excel.ods:
| -:145: element subtitle: Relax-NG validity error : Invalid attribute cell-address for element subtitle
| - fails to validate
While checking Graph28/content.xml from chart-tests-excel.ods:
| -:145: element subtitle: Relax-NG validity error : Invalid attribute cell-address for element subtitle
| - fails to validate
While checking Graph40/content.xml from chart-tests-excel.ods:
| -:115: element subtitle: Relax-NG validity error : Invalid attribute cell-address for element subtitle
| - fails to validate


(No complaints over graph-tests -- strange)
Comment 1 Andreas J. Guelzow 2014-05-19 19:23:22 UTC
For subtitles we are writing both:
	gsf_xml_out_add_cstr (state->xml, TABLE "cell-address", f);
	gsf_xml_out_add_cstr (state->xml, TABLE "cell-range", f);

According to 1.2 as released it should just be cell-range, but I suspect there is more to this. Some code documentation would be nice!
Comment 2 Andreas J. Guelzow 2014-05-19 19:32:04 UTC
I guess this all comes from an error in ODF 1.0: 

The <chart:title> element represents a main title object in a chart document. This element can contain fixed text or it can contain a <table:cell-address> element pointing to the text that should be displayed as the title.

this contradicts the schema that says:

<define name="chart-title">
<element name="chart:title">
<ref name="chart-title-attlist"/>
<optional>
<ref name="text-p"/>
</optional>
</element>
</define>


By now this should have been fixed in any likely consumer and we can drop writing the table:cell-address.
Comment 3 Andreas J. Guelzow 2014-05-19 19:52:19 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 4 Morten Welinder 2014-05-19 23:17:49 UTC
If I check the "Gnumeric_OpenCalc:odf" format instead, I get tons
of errors like below.  Is this something we ought to worry about?


While checking content.xml from address.ods:
| -:8: element table-properties: Relax-NG validity error : Expecting element map, got table-properties
| -:8: element table-properties: Relax-NG validity error : Element style has extra content: table-properties
| Relax-NG validity error : Extra element style in interleave
| -:6: element automatic-styles: Relax-NG validity error : Invalid sequence in interleave
| -:6: element automatic-styles: Relax-NG validity error : Element automatic-styles failed to validate content
| -:213: element table-cell: Relax-NG validity error : Invalid attribute error-value for element table-cell
| -:210: element table-row: Relax-NG validity error : Expecting element table-header-rows, got table-row
| -:185: element table-row: Relax-NG validity error : Element table has extra content: table-row
| -:1127: element table-cell: Relax-NG validity error : Invalid attribute error-value for element table-cell
| -:1119: element table-row: Relax-NG validity error : Expecting element table-header-rows, got table-row
| -:1119: element table-row: Relax-NG validity error : Element table has extra content: table-row
| - fails to validate
While checking styles.xml from address.ods:
| -:4: element table-cell-properties: Relax-NG validity error : Expecting element map, got table-cell-properties
| -:4: element table-cell-properties: Relax-NG validity error : Element style has extra content: table-cell-properties
| Relax-NG validity error : Extra element style in interleave
...
Comment 5 Andreas J. Guelzow 2014-05-20 01:41:44 UTC
If we use "Gnumeric_OpenCalc:odf", we need to ignore all foreign elements and attributes, i.e. all elements and attributes in name spaces not defined in ODF. 

The errors above look to me like the parser got confused by those foreign elements:
address.ods/content.xml: Info: 4 extension elements from the following namespace were found: http://www.gnumeric.org/odf-extension/1.0
address.ods/content.xml: Info: 1767 extension attributes from the following namespace were found: http://www.gnumeric.org/odf-extension/1.0

So there are lots of places where things can go haywire.