summaryrefslogtreecommitdiff
path: root/xmlWorkbook.go
diff options
context:
space:
mode:
Diffstat (limited to 'xmlWorkbook.go')
-rw-r--r--xmlWorkbook.go36
1 files changed, 22 insertions, 14 deletions
diff --git a/xmlWorkbook.go b/xmlWorkbook.go
index ad66f42..bc59924 100644
--- a/xmlWorkbook.go
+++ b/xmlWorkbook.go
@@ -1,24 +1,24 @@
-// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
// this source code is governed by a BSD-style license that can be found in
// the LICENSE file.
//
// Package excelize providing a set of functions that allow you to write to
// and read from XLSX files. Support reads and writes XLSX file generated by
// Microsoft Excelâ„¢ 2007 and later. Support save file without losing original
-// charts of XLSX. This library needs Go version 1.8 or later.
+// charts of XLSX. This library needs Go version 1.10 or later.
package excelize
import "encoding/xml"
-// xmlxWorkbookRels contains xmlxWorkbookRelations which maps sheet id and sheet XML.
-type xlsxWorkbookRels struct {
- XMLName xml.Name `xml:"http://schemas.openxmlformats.org/package/2006/relationships Relationships"`
- Relationships []xlsxWorkbookRelation `xml:"Relationship"`
+// xlsxRelationships describe references from parts to other internal resources in the package or to external resources.
+type xlsxRelationships struct {
+ XMLName xml.Name `xml:"http://schemas.openxmlformats.org/package/2006/relationships Relationships"`
+ Relationships []xlsxRelationship `xml:"Relationship"`
}
-// xmlxWorkbookRelation maps sheet id and xl/worksheets/_rels/sheet%d.xml.rels
-type xlsxWorkbookRelation struct {
+// xlsxRelationship contains relations which maps id and XML.
+type xlsxRelationship struct {
ID string `xml:"Id,attr"`
Target string `xml:",attr"`
Type string `xml:",attr"`
@@ -33,7 +33,7 @@ type xlsxWorkbook struct {
FileVersion *xlsxFileVersion `xml:"fileVersion"`
WorkbookPr *xlsxWorkbookPr `xml:"workbookPr"`
WorkbookProtection *xlsxWorkbookProtection `xml:"workbookProtection"`
- BookViews xlsxBookViews `xml:"bookViews"`
+ BookViews *xlsxBookViews `xml:"bookViews"`
Sheets xlsxSheets `xml:"sheets"`
ExternalReferences *xlsxExternalReferences `xml:"externalReferences"`
DefinedNames *xlsxDefinedNames `xml:"definedNames"`
@@ -146,9 +146,8 @@ type xlsxSheets struct {
Sheet []xlsxSheet `xml:"sheet"`
}
-// xlsxSheet directly maps the sheet element from the namespace
-// http://schemas.openxmlformats.org/spreadsheetml/2006/main - currently I have
-// not checked it for completeness - it does as much as I need.
+// xlsxSheet defines a sheet in this workbook. Sheet data is stored in a
+// separate part.
type xlsxSheet struct {
Name string `xml:"name,attr,omitempty"`
SheetID int `xml:"sheetId,attr,omitempty"`
@@ -176,7 +175,7 @@ type xlsxPivotCaches struct {
// xlsxPivotCache directly maps the pivotCache element.
type xlsxPivotCache struct {
- CacheID int `xml:"cacheId,attr,omitempty"`
+ CacheID int `xml:"cacheId,attr"`
RID string `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"`
}
@@ -204,7 +203,7 @@ type xlsxDefinedNames struct {
// http://schemas.openxmlformats.org/spreadsheetml/2006/main This element
// defines a defined name within this workbook. A defined name is descriptive
// text that is used to represents a cell, range of cells, formula, or constant
-// value. For a descriptions of the attributes see https://msdn.microsoft.com/en-us/library/office/documentformat.openxml.spreadsheet.definedname.aspx
+// value. For a descriptions of the attributes see https://docs.microsoft.com/en-us/dotnet/api/documentformat.openxml.spreadsheet.definedname
type xlsxDefinedName struct {
Comment string `xml:"comment,attr,omitempty"`
CustomMenu string `xml:"customMenu,attr,omitempty"`
@@ -289,3 +288,12 @@ type xlsxCustomWorkbookView struct {
XWindow *int `xml:"xWindow,attr"`
YWindow *int `xml:"yWindow,attr"`
}
+
+// DefinedName directly maps the name for a cell or cell range on a
+// worksheet.
+type DefinedName struct {
+ Name string
+ Comment string
+ RefersTo string
+ Scope string
+}