xmlContentTypes.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright 2016 - 2020 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 files. Support reads and writes XLSX file generated by
  7. // Microsoft Excel™ 2007 and later. Support save file without losing original
  8. // charts of XLSX. This library needs Go version 1.10 or later.
  9. package excelize
  10. import "encoding/xml"
  11. // xlsxTypes directly maps the types element of content types for relationship
  12. // parts, it takes a Multipurpose Internet Mail Extension (MIME) media type as a
  13. // value.
  14. type xlsxTypes struct {
  15. XMLName xml.Name `xml:"http://schemas.openxmlformats.org/package/2006/content-types Types"`
  16. Overrides []xlsxOverride `xml:"Override"`
  17. Defaults []xlsxDefault `xml:"Default"`
  18. }
  19. // xlsxOverride directly maps the override element in the namespace
  20. // http://schemas.openxmlformats.org/package/2006/content-types
  21. type xlsxOverride struct {
  22. PartName string `xml:",attr"`
  23. ContentType string `xml:",attr"`
  24. }
  25. // xlsxDefault directly maps the default element in the namespace
  26. // http://schemas.openxmlformats.org/package/2006/content-types
  27. type xlsxDefault struct {
  28. Extension string `xml:",attr"`
  29. ContentType string `xml:",attr"`
  30. }