xmlContentTypes.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. Package excelize providing a set of functions that allow you to write to
  3. and read from XLSX files. Support reads and writes XLSX file generated by
  4. Microsoft Excel™ 2007 and later. Support save file without losing original
  5. charts of XLSX. This library needs Go version 1.8 or later.
  6. Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
  7. this source code is governed by a BSD-style license that can be found in
  8. the LICENSE file.
  9. */
  10. package excelize
  11. import "encoding/xml"
  12. // xlsxTypes directly maps the types element of content types for relationship
  13. // parts, it takes a Multipurpose Internet Mail Extension (MIME) media type as a
  14. // value.
  15. type xlsxTypes struct {
  16. XMLName xml.Name `xml:"http://schemas.openxmlformats.org/package/2006/content-types Types"`
  17. Overrides []xlsxOverride `xml:"Override"`
  18. Defaults []xlsxDefault `xml:"Default"`
  19. }
  20. // xlsxOverride directly maps the override element in the namespace
  21. // http://schemas.openxmlformats.org/package/2006/content-types
  22. type xlsxOverride struct {
  23. PartName string `xml:",attr"`
  24. ContentType string `xml:",attr"`
  25. }
  26. // xlsxDefault directly maps the default element in the namespace
  27. // http://schemas.openxmlformats.org/package/2006/content-types
  28. type xlsxDefault struct {
  29. Extension string `xml:",attr"`
  30. ContentType string `xml:",attr"`
  31. }