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 581896 - xlsx saving - schema error (empty sheetProtection element)
xlsx saving - schema error (empty sheetProtection element)
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: import/export MS Excel (tm)
1.9.x
Other Windows
: Normal normal
: ---
Assigned To: Andreas J. Guelzow
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2009-05-08 16:27 UTC by Vyacheslav Sedov
Modified: 2009-05-10 17:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wrong file (11.49 KB, application/octet-stream)
2009-05-09 14:41 UTC, Vyacheslav Sedov
Details
fixed sample file (11.51 KB, application/octet-stream)
2009-05-10 05:10 UTC, Andreas J. Guelzow
Details

Description Vyacheslav Sedov 2009-05-08 16:27:32 UTC
<sheetProtection formatCells="0" formatColumns="0" formatRows="0" insertColumns="0" insertRows="0" insertHyperlinks="0" deleteColumns="0" deleteRows="0" selectLockedCells="1" sort="0" autoFilter="0" pivotTables="0" selectUnlockedCells="1"/>

E [oNVDL] cvc-complex-type.2.4.a: Invalid content was found starting with element 'sheetProtection'. One of '{"http://schemas.openxmlformats.org/spreadsheetml/2006/main":phoneticPr, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":conditionalFormatting, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":dataValidations, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":hyperlinks, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":printOptions, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":pageMargins, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":pageSetup, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":headerFooter, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":rowBreaks, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":colBreaks, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":customProperties, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":cellWatches, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":ignoredErrors, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":smartTags, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":drawing, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":legacyDrawing, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":legacyDrawingHF, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":picture, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":oleObjects, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":controls, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":webPublishItems, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":tableParts, "http://schemas.openxmlformats.org/spreadsheetml/2006/main":extLst}' is expected.
Comment 1 Morten Welinder 2009-05-08 16:46:36 UTC
Why do you consider this critical?
http://bugzilla.gnome.org/page.cgi?id=bug-status.html#bug_severity
Comment 2 Vyacheslav Sedov 2009-05-08 17:28:37 UTC
i can`t open this document in MS Word at all (probably many more users around the world too) so i think this is same as "loss of data" (MS Office open document as empty after "healing attempt" - not many peoples can open xlsx in Oxygenxml to repair "by hands") 

as XML developer i guess any XSD/DTD error is critical

also i think that MS use unfair game with not MS-generated documents, so schema error work against Open Source, i don`t know why "healer" clear whole document so i think - no DTD schema errors - no "healer" - no data loss

as workaround i just remove "by hands" bad element and load xlsx again - OK
Comment 3 Andreas J. Guelzow 2009-05-08 20:12:47 UTC
Can you open the file in gnumeric? Is your data still there?
Comment 4 Vyacheslav Sedov 2009-05-08 20:25:52 UTC
yep Gnumeric open this file

but what if user send this file to other person who have only MS Office 2007?
Comment 5 Andreas J. Guelzow 2009-05-08 21:18:30 UTC
Well, this is (or at least may be) a bug, but since there is no real data loss, let's change the severity to "normal".

Now looking just at the piece of code you included, I don't see anything wrong:

<complexType name="CT_SheetProtection">

<attribute name="password" type="ST_UnsignedShortHex" use="optional"/>

<attribute name="sheet" type="xsd:boolean" use="optional" default="false"/>

<attribute name="objects" type="xsd:boolean" use="optional" default="false"/>

<attribute name="scenarios" type="xsd:boolean" use="optional" default="false"/>

<attribute name="formatCells" type="xsd:boolean" use="optional" default="true"/>

<attribute name="formatColumns" type="xsd:boolean" use="optional" default="true"/>

<attribute name="formatRows" type="xsd:boolean" use="optional" default="true"/>

<attribute name="insertColumns" type="xsd:boolean" use="optional" default="true"/>

<attribute name="insertRows" type="xsd:boolean" use="optional" default="true"/>

<attribute name="insertHyperlinks" type="xsd:boolean" use="optional" default="true"/>

<attribute name="deleteColumns" type="xsd:boolean" use="optional" default="true"/>

<attribute name="deleteRows" type="xsd:boolean" use="optional" default="true"/>

<attribute name="selectLockedCells" type="xsd:boolean" use="optional" default="false"/>

<attribute name="sort" type="xsd:boolean" use="optional" default="true"/>

<attribute name="autoFilter" type="xsd:boolean" use="optional" default="true"/>

<attribute name="pivotTables" type="xsd:boolean" use="optional" default="true"/>

<attribute name="selectUnlockedCells" type="xsd:boolean" use="optional" default="false"/>

</complexType>

Would you be able to provide the file or at least a larger snippet?
Comment 6 Andreas J. Guelzow 2009-05-09 04:59:29 UTC
I just realize that the error message may in fact say that the problem is not that the sheetProtection element is empty but that the element itself appears in a content that does not allow that element.
Comment 7 Vyacheslav Sedov 2009-05-09 08:58:59 UTC
yep here fixed sequence order i note that many others elements not in proper order too - please fix, not follow to schema is not good way - same as "street OOXML" :)

<complexType name="CT_Worksheet">

<sequence>

<element name="sheetPr" type="CT_SheetPr" minOccurs="0" maxOccurs="1"/>

<element name="dimension" type="CT_SheetDimension" minOccurs="0" maxOccurs="1"/>

<element name="sheetViews" type="CT_SheetViews" minOccurs="0" maxOccurs="1"/>

<element name="sheetFormatPr" type="CT_SheetFormatPr" minOccurs="0" maxOccurs="1"/>

<element name="cols" type="CT_Cols" minOccurs="0" maxOccurs="unbounded"/>

<element name="sheetData" type="CT_SheetData" minOccurs="1" maxOccurs="1"/>

<element name="sheetCalcPr" type="CT_SheetCalcPr" minOccurs="0" maxOccurs="1"/>

<element name="sheetProtection" type="CT_SheetProtection" minOccurs="0" maxOccurs="1"/>

<element name="protectedRanges" type="CT_ProtectedRanges" minOccurs="0" maxOccurs="1"/>

<element name="scenarios" type="CT_Scenarios" minOccurs="0" maxOccurs="1"/>

<element name="autoFilter" type="CT_AutoFilter" minOccurs="0" maxOccurs="1"/>

<element name="sortState" type="CT_SortState" minOccurs="0" maxOccurs="1"/>

<element name="dataConsolidate" type="CT_DataConsolidate" minOccurs="0" maxOccurs="1"/>

<element name="customSheetViews" type="CT_CustomSheetViews" minOccurs="0" maxOccurs="1"/>

<element name="mergeCells" type="CT_MergeCells" minOccurs="0" maxOccurs="1"/>

<element name="phoneticPr" type="CT_PhoneticPr" minOccurs="0" maxOccurs="1"/>

<element name="conditionalFormatting" type="CT_ConditionalFormatting" minOccurs="0" maxOccurs="unbounded"/>

<element name="dataValidations" type="CT_DataValidations" minOccurs="0" maxOccurs="1"/>

<element name="hyperlinks" type="CT_Hyperlinks" minOccurs="0" maxOccurs="1"/>

<element name="printOptions" type="CT_PrintOptions" minOccurs="0" maxOccurs="1"/>

<element name="pageMargins" type="CT_PageMargins" minOccurs="0" maxOccurs="1"/>

<element name="pageSetup" type="CT_PageSetup" minOccurs="0" maxOccurs="1"/>

<element name="headerFooter" type="CT_HeaderFooter" minOccurs="0" maxOccurs="1"/>

<element name="rowBreaks" type="CT_PageBreak" minOccurs="0" maxOccurs="1"/>

<element name="colBreaks" type="CT_PageBreak" minOccurs="0" maxOccurs="1"/>

<element name="customProperties" type="CT_CustomProperties" minOccurs="0" maxOccurs="1"/>

<element name="cellWatches" type="CT_CellWatches" minOccurs="0" maxOccurs="1"/>

<element name="ignoredErrors" type="CT_IgnoredErrors" minOccurs="0" maxOccurs="1"/>

<element name="smartTags" type="CT_SmartTags" minOccurs="0" maxOccurs="1"/>

<element name="drawing" type="CT_Drawing" minOccurs="0" maxOccurs="1"/>

<element name="legacyDrawing" type="CT_LegacyDrawing" minOccurs="0" maxOccurs="1"/>

<element name="legacyDrawingHF" type="CT_LegacyDrawing" minOccurs="0" maxOccurs="1"/>

<element name="picture" type="CT_SheetBackgroundPicture" minOccurs="0" maxOccurs="1"/>

<element name="oleObjects" type="CT_OleObjects" minOccurs="0" maxOccurs="1"/>

<element name="controls" type="CT_Controls" minOccurs="0" maxOccurs="1"/>

<element name="webPublishItems" type="CT_WebPublishItems" minOccurs="0" maxOccurs="1"/>

<element name="tableParts" type="CT_TableParts" minOccurs="0" maxOccurs="1"/>

<element name="extLst" type="CT_ExtensionList" minOccurs="0" maxOccurs="1"/>

</sequence>

</complexType>
Comment 8 Andreas J. Guelzow 2009-05-09 14:29:43 UTC
Please _provide_ us with a file that we generated that does not follow the schema. There is nothing wrong with the  sheetProtection tag itself.

So I don't know what you mean with "that many others elements not in proper
order too". I am not aware of _any_ element that does not appear in proper order.

Comment 9 Vyacheslav Sedov 2009-05-09 14:41:18 UTC
Created attachment 134308 [details]
wrong file
Comment 10 Andreas J. Guelzow 2009-05-09 14:51:45 UTC
Thank you
Comment 11 Andreas J. Guelzow 2009-05-10 05:10:48 UTC
Created attachment 134345 [details]
fixed sample file

I opened the "incorrect" file with gnumeric (after fixing gnumeric) resaved it. Please check whether this file is correct.
Comment 12 Vyacheslav Sedov 2009-05-10 05:50:22 UTC
yep - it is ok

thank you for fast fixing
Comment 13 Andreas J. Guelzow 2009-05-10 17:53:30 UTC
We aim to please.

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.