GNOME Bugzilla – Bug 581896
xlsx saving - schema error (empty sheetProtection element)
Last modified: 2009-05-10 17:53:30 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.
Why do you consider this critical? http://bugzilla.gnome.org/page.cgi?id=bug-status.html#bug_severity
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
Can you open the file in gnumeric? Is your data still there?
yep Gnumeric open this file but what if user send this file to other person who have only MS Office 2007?
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?
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.
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>
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.
Created attachment 134308 [details] wrong file
Thank you
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.
yep - it is ok thank you for fast fixing
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.