|
|
@@ -12,12 +12,12 @@ import (
|
|
|
// currently I have not checked it for completeness - it does as much
|
|
|
// as I need.
|
|
|
type XLSXWorkbook struct {
|
|
|
- FileVersion XLSXFileVersion
|
|
|
- WorkbookPr XLSXWorkbookPr
|
|
|
- BookViews XLSXBookViews
|
|
|
- Sheets XLSXSheets
|
|
|
- DefinedNames XLSXDefinedNames
|
|
|
- CalcPr XLSXCalcPr
|
|
|
+ FileVersion XLSXFileVersion `xml:"fileVersion"`
|
|
|
+ WorkbookPr XLSXWorkbookPr `xml:"workbookPr"`
|
|
|
+ BookViews XLSXBookViews `xml:"bookViews"`
|
|
|
+ Sheets XLSXSheets `xml:"sheets"`
|
|
|
+ DefinedNames XLSXDefinedNames `xml:"definedNames"`
|
|
|
+ CalcPr XLSXCalcPr `xml:"calcPr"`
|
|
|
}
|
|
|
|
|
|
// XLSXFileVersion directly maps the fileVersion element from the
|
|
|
@@ -25,10 +25,10 @@ type XLSXWorkbook struct {
|
|
|
// - currently I have not checked it for completeness - it does as
|
|
|
// much as I need.
|
|
|
type XLSXFileVersion struct {
|
|
|
- AppName string `xml:"attr"`
|
|
|
- LastEdited string `xml:"attr"`
|
|
|
- LowestEdited string `xml:"attr"`
|
|
|
- RupBuild string `xml:"attr"`
|
|
|
+ AppName string `xml:"appName,attr"`
|
|
|
+ LastEdited string `xml:"lastEdited,attr"`
|
|
|
+ LowestEdited string `xml:"lowestEdited,attr"`
|
|
|
+ RupBuild string `xml:"rupBuild,attr"`
|
|
|
}
|
|
|
|
|
|
// XLSXWorkbookPr directly maps the workbookPr element from the
|
|
|
@@ -36,7 +36,7 @@ type XLSXFileVersion struct {
|
|
|
// - currently I have not checked it for completeness - it does as
|
|
|
// much as I need.
|
|
|
type XLSXWorkbookPr struct {
|
|
|
- DefaultThemeVersion string `xml:"attr"`
|
|
|
+ DefaultThemeVersion string `xml:"defaultThemeVersion,attr"`
|
|
|
}
|
|
|
|
|
|
// XLSXBookViews directly maps the bookViews element from the
|
|
|
@@ -44,7 +44,7 @@ type XLSXWorkbookPr struct {
|
|
|
// - currently I have not checked it for completeness - it does as
|
|
|
// much as I need.
|
|
|
type XLSXBookViews struct {
|
|
|
- WorkBookView []XLSXWorkBookView
|
|
|
+ WorkBookView []XLSXWorkBookView `xml:"workbookView"`
|
|
|
}
|
|
|
|
|
|
// XLSXWorkBookView directly maps the workbookView element from the
|
|
|
@@ -52,10 +52,10 @@ type XLSXBookViews struct {
|
|
|
// - currently I have not checked it for completeness - it does as
|
|
|
// much as I need.
|
|
|
type XLSXWorkBookView struct {
|
|
|
- XWindow string `xml:"attr"`
|
|
|
- YWindow string `xml:"attr"`
|
|
|
- WindowWidth string `xml:"attr"`
|
|
|
- WindowHeight string `xml:"attr"`
|
|
|
+ XWindow string `xml:"xWindow,attr"`
|
|
|
+ YWindow string `xml:"yWindow,attr"`
|
|
|
+ WindowWidth string `xml:"windowWidth,attr"`
|
|
|
+ WindowHeight string `xml:"windowHeight,attr"`
|
|
|
}
|
|
|
|
|
|
// XLSXSheets directly maps the sheets element from the namespace
|
|
|
@@ -63,7 +63,7 @@ type XLSXWorkBookView struct {
|
|
|
// currently I have not checked it for completeness - it does as much
|
|
|
// as I need.
|
|
|
type XLSXSheets struct {
|
|
|
- Sheet []XLSXSheet
|
|
|
+ Sheet []XLSXSheet `xml:"sheet"`
|
|
|
}
|
|
|
|
|
|
// XLSXSheet directly maps the sheet element from the namespace
|
|
|
@@ -71,9 +71,9 @@ type XLSXSheets struct {
|
|
|
// currently I have not checked it for completeness - it does as much
|
|
|
// as I need.
|
|
|
type XLSXSheet struct {
|
|
|
- Name string `xml:"attr"`
|
|
|
- SheetId string `xml:"attr"`
|
|
|
- Id string `xml:"attr"`
|
|
|
+ Name string `xml:"name,attr"`
|
|
|
+ SheetId string `xml:"sheetId,attr"`
|
|
|
+ Id string `xml:"id,attr"`
|
|
|
}
|
|
|
|
|
|
// XLSXDefinedNames directly maps the definedNames element from the
|
|
|
@@ -81,7 +81,7 @@ type XLSXSheet struct {
|
|
|
// - currently I have not checked it for completeness - it does as
|
|
|
// much as I need.
|
|
|
type XLSXDefinedNames struct {
|
|
|
- DefinedName []XLSXDefinedName
|
|
|
+ DefinedName []XLSXDefinedName `xml:"definedName"`
|
|
|
}
|
|
|
|
|
|
// XLSXDefinedName directly maps the definedName element from the
|
|
|
@@ -89,9 +89,9 @@ type XLSXDefinedNames struct {
|
|
|
// - currently I have not checked it for completeness - it does as
|
|
|
// much as I need.
|
|
|
type XLSXDefinedName struct {
|
|
|
- Data string `xml:"chardata"`
|
|
|
- Name string `xml:"attr"`
|
|
|
- LocalSheetID string `xml:"attr"`
|
|
|
+ Data string `xml:",chardata"`
|
|
|
+ Name string `xml:"name,attr"`
|
|
|
+ LocalSheetID string `xml:"localSheetId,attr"`
|
|
|
}
|
|
|
|
|
|
// XLSXCalcPr directly maps the calcPr element from the namespace
|
|
|
@@ -99,7 +99,7 @@ type XLSXDefinedName struct {
|
|
|
// currently I have not checked it for completeness - it does as much
|
|
|
// as I need.
|
|
|
type XLSXCalcPr struct {
|
|
|
- CalcId string `xml:"attr"`
|
|
|
+ CalcId string `xml:"calcId,attr"`
|
|
|
}
|
|
|
|
|
|
// getWorksheetFromSheet() is an internal helper function to open a sheetN.xml file, refered to by an xlsx.XLSXSheet struct, from the XLSX file and unmarshal it an xlsx.XLSXWorksheet struct
|