|
@@ -256,10 +256,11 @@ func (l *FileSuite) TestMarshalWorkbook(c *C) {
|
|
|
State: "visible"}
|
|
State: "visible"}
|
|
|
|
|
|
|
|
expectedWorkbook := `<?xml version="1.0" encoding="UTF-8"?>
|
|
expectedWorkbook := `<?xml version="1.0" encoding="UTF-8"?>
|
|
|
-<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><fileVersion appName="Go XLSX"></fileVersion><workbookPr showObjects="all" date1904="false"></workbookPr><workbookProtection></workbookProtection><bookViews><workbookView showHorizontalScroll="true" showVerticalScroll="true" showSheetTabs="true" tabRatio="204" windowHeight="8192" windowWidth="16384" xWindow="0" yWindow="0"></workbookView></bookViews><sheets><sheet name="MyFirstSheet" sheetId="1" xmlns:relationships="http://schemas.openxmlformats.org/officeDocument/2006/relationships" relationships:id="rId1" state="visible"></sheet><sheet name="MySecondSheet" sheetId="2" xmlns:relationships="http://schemas.openxmlformats.org/officeDocument/2006/relationships" relationships:id="rId2" state="visible"></sheet></sheets><definedNames></definedNames><calcPr iterateCount="100" refMode="A1" iterateDelta="0.001"></calcPr></workbook>`
|
|
|
|
|
|
|
+<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><fileVersion appName="Go XLSX"></fileVersion><workbookPr showObjects="all" date1904="false"></workbookPr><workbookProtection></workbookProtection><bookViews><workbookView showHorizontalScroll="true" showVerticalScroll="true" showSheetTabs="true" tabRatio="204" windowHeight="8192" windowWidth="16384" xWindow="0" yWindow="0"></workbookView></bookViews><sheets><sheet name="MyFirstSheet" sheetId="1" r:id="rId1" state="visible"></sheet><sheet name="MySecondSheet" sheetId="2" r:id="rId2" state="visible"></sheet></sheets><definedNames></definedNames><calcPr iterateCount="100" refMode="A1" iterateDelta="0.001"></calcPr></workbook>`
|
|
|
output, err := xml.Marshal(workbook)
|
|
output, err := xml.Marshal(workbook)
|
|
|
c.Assert(err, IsNil)
|
|
c.Assert(err, IsNil)
|
|
|
- stringOutput := xml.Header + string(output)
|
|
|
|
|
|
|
+ outputStr := replacingWorkbookSheetId(string(output))
|
|
|
|
|
+ stringOutput := xml.Header + outputStr
|
|
|
c.Assert(stringOutput, Equals, expectedWorkbook)
|
|
c.Assert(stringOutput, Equals, expectedWorkbook)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -646,7 +647,7 @@ func (l *FileSuite) TestMarshalFile(c *C) {
|
|
|
// added in file.go to support Apple Numbers so the test passes.
|
|
// added in file.go to support Apple Numbers so the test passes.
|
|
|
// `xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"`
|
|
// `xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"`
|
|
|
expectedWorkbook := `<?xml version="1.0" encoding="UTF-8"?>
|
|
expectedWorkbook := `<?xml version="1.0" encoding="UTF-8"?>
|
|
|
-<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><fileVersion appName="Go XLSX"></fileVersion><workbookPr showObjects="all" date1904="false"></workbookPr><workbookProtection></workbookProtection><bookViews><workbookView showHorizontalScroll="true" showVerticalScroll="true" showSheetTabs="true" tabRatio="204" windowHeight="8192" windowWidth="16384" xWindow="0" yWindow="0"></workbookView></bookViews><sheets><sheet name="MySheet" sheetId="1" xmlns:relationships="http://schemas.openxmlformats.org/officeDocument/2006/relationships" relationships:id="rId1" state="visible"></sheet><sheet name="AnotherSheet" sheetId="2" xmlns:relationships="http://schemas.openxmlformats.org/officeDocument/2006/relationships" relationships:id="rId2" state="visible"></sheet></sheets><definedNames></definedNames><calcPr iterateCount="100" refMode="A1" iterateDelta="0.001"></calcPr></workbook>`
|
|
|
|
|
|
|
+<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><fileVersion appName="Go XLSX"></fileVersion><workbookPr showObjects="all" date1904="false"></workbookPr><workbookProtection></workbookProtection><bookViews><workbookView showHorizontalScroll="true" showVerticalScroll="true" showSheetTabs="true" tabRatio="204" windowHeight="8192" windowWidth="16384" xWindow="0" yWindow="0"></workbookView></bookViews><sheets><sheet name="MySheet" sheetId="1" r:id="rId1" state="visible"></sheet><sheet name="AnotherSheet" sheetId="2" r:id="rId2" state="visible"></sheet></sheets><definedNames></definedNames><calcPr iterateCount="100" refMode="A1" iterateDelta="0.001"></calcPr></workbook>`
|
|
|
c.Assert(parts["xl/workbook.xml"], Equals, expectedWorkbook)
|
|
c.Assert(parts["xl/workbook.xml"], Equals, expectedWorkbook)
|
|
|
|
|
|
|
|
// [Content_Types].xml
|
|
// [Content_Types].xml
|