xmlContentTypes.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2016 - 2021 The excelize Authors. All rights reserved. Use of
  2. // this source code is governed by a BSD-style license that can be found in
  3. // the LICENSE file.
  4. //
  5. // Package excelize providing a set of functions that allow you to write to
  6. // and read from XLSX / XLSM / XLTM files. Supports reading and writing
  7. // spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
  8. // complex components by high compatibility, and provided streaming API for
  9. // generating or reading data from a worksheet with huge amounts of data. This
  10. // library needs Go version 1.15 or later.
  11. package excelize
  12. import "encoding/xml"
  13. // xlsxTypes directly maps the types element of content types for relationship
  14. // parts, it takes a Multipurpose Internet Mail Extension (MIME) media type as a
  15. // value.
  16. type xlsxTypes struct {
  17. XMLName xml.Name `xml:"http://schemas.openxmlformats.org/package/2006/content-types Types"`
  18. Overrides []xlsxOverride `xml:"Override"`
  19. Defaults []xlsxDefault `xml:"Default"`
  20. }
  21. // xlsxOverride directly maps the override element in the namespace
  22. // http://schemas.openxmlformats.org/package/2006/content-types
  23. type xlsxOverride struct {
  24. PartName string `xml:",attr"`
  25. ContentType string `xml:",attr"`
  26. }
  27. // xlsxDefault directly maps the default element in the namespace
  28. // http://schemas.openxmlformats.org/package/2006/content-types
  29. type xlsxDefault struct {
  30. Extension string `xml:",attr"`
  31. ContentType string `xml:",attr"`
  32. }