xmlWorksheet.go 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package xlsx
  2. import (
  3. "encoding/xml"
  4. )
  5. // xlsxWorksheet directly maps the worksheet element in the namespace
  6. // http://schemas.openxmlformats.org/spreadsheetml/2006/main -
  7. // currently I have not checked it for completeness - it does as much
  8. // as I need.
  9. type xlsxWorksheet struct {
  10. XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main worksheet"`
  11. Dimension xlsxDimension `xml:"dimension"`
  12. Cols xlsxCols `xml:"cols,omitempty"`
  13. SheetData xlsxSheetData `xml:"sheetData"`
  14. }
  15. // xlsxCols directly maps the cols element in the namespace
  16. // http://schemas.openxmlformats.org/spreadsheetml/2006/main -
  17. // currently I have not checked it for completeness - it does as much
  18. // as I need.
  19. type xlsxCols struct {
  20. Col []xlsxCol `xml:"col"`
  21. }
  22. // xlsxCol directly maps the col element in the namespace
  23. // http://schemas.openxmlformats.org/spreadsheetml/2006/main -
  24. // currently I have not checked it for completeness - it does as much
  25. // as I need.
  26. type xlsxCol struct {
  27. Min int `xml:"min,attr"`
  28. Max int `xml:"max,attr"`
  29. Hidden bool `xml:"hidden,attr,omitempty"`
  30. Width float64 `xml:"width,attr,omitempty"`
  31. }
  32. // xlsxDimension directly maps the dimension element in the namespace
  33. // http://schemas.openxmlformats.org/spreadsheetml/2006/main -
  34. // currently I have not checked it for completeness - it does as much
  35. // as I need.
  36. type xlsxDimension struct {
  37. Ref string `xml:"ref,attr"`
  38. }
  39. // xlsxSheetData directly maps the sheetData element in the namespace
  40. // http://schemas.openxmlformats.org/spreadsheetml/2006/main -
  41. // currently I have not checked it for completeness - it does as much
  42. // as I need.
  43. type xlsxSheetData struct {
  44. XMLName xml.Name `xml:"sheetData"`
  45. Row []xlsxRow `xml:"row"`
  46. }
  47. // xlsxRow directly maps the row element in the namespace
  48. // http://schemas.openxmlformats.org/spreadsheetml/2006/main -
  49. // currently I have not checked it for completeness - it does as much
  50. // as I need.
  51. type xlsxRow struct {
  52. R int `xml:"r,attr"`
  53. Spans string `xml:"spans,attr,omitempty"`
  54. Hidden bool `xml:"hidden,attr,omitempty"`
  55. C []xlsxC `xml:"c"`
  56. }
  57. // xlsxC directly maps the c element in the namespace
  58. // http://schemas.openxmlformats.org/sprceadsheetml/2006/main -
  59. // currently I have not checked it for completeness - it does as much
  60. // as I need.
  61. type xlsxC struct {
  62. R string `xml:"r,attr"` // Cell ID, e.g. A1
  63. S int `xml:"s,attr,omitempty"` // Style reference.
  64. T string `xml:"t,attr"` // Type.
  65. V string `xml:"v"` // Value
  66. }