xmlContentTypes.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 (
  13. "encoding/xml"
  14. "sync"
  15. )
  16. // xlsxTypes directly maps the types element of content types for relationship
  17. // parts, it takes a Multipurpose Internet Mail Extension (MIME) media type as a
  18. // value.
  19. type xlsxTypes struct {
  20. sync.Mutex
  21. XMLName xml.Name `xml:"http://schemas.openxmlformats.org/package/2006/content-types Types"`
  22. Overrides []xlsxOverride `xml:"Override"`
  23. Defaults []xlsxDefault `xml:"Default"`
  24. }
  25. // xlsxOverride directly maps the override element in the namespace
  26. // http://schemas.openxmlformats.org/package/2006/content-types
  27. type xlsxOverride struct {
  28. PartName string `xml:",attr"`
  29. ContentType string `xml:",attr"`
  30. }
  31. // xlsxDefault directly maps the default element in the namespace
  32. // http://schemas.openxmlformats.org/package/2006/content-types
  33. type xlsxDefault struct {
  34. Extension string `xml:",attr"`
  35. ContentType string `xml:",attr"`
  36. }