xmlWorksheet.go 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. }
  31. // xlsxDimension directly maps the dimension element in the namespace
  32. // http://schemas.openxmlformats.org/spreadsheetml/2006/main -
  33. // currently I have not checked it for completeness - it does as much
  34. // as I need.
  35. type xlsxDimension struct {
  36. Ref string `xml:"ref,attr"`
  37. }
  38. // xlsxSheetData directly maps the sheetData element in the namespace
  39. // http://schemas.openxmlformats.org/spreadsheetml/2006/main -
  40. // currently I have not checked it for completeness - it does as much
  41. // as I need.
  42. type xlsxSheetData struct {
  43. XMLName xml.Name `xml:"sheetData"`
  44. Row []xlsxRow `xml:"row"`
  45. }
  46. // xlsxRow directly maps the row element in the namespace
  47. // http://schemas.openxmlformats.org/spreadsheetml/2006/main -
  48. // currently I have not checked it for completeness - it does as much
  49. // as I need.
  50. type xlsxRow struct {
  51. R int `xml:"r,attr"`
  52. Spans string `xml:"spans,attr,omitempty"`
  53. Hidden bool `xml:"hidden,attr,omitempty"`
  54. C []xlsxC `xml:"c"`
  55. }
  56. // xlsxC directly maps the c element in the namespace
  57. // http://schemas.openxmlformats.org/sprceadsheetml/2006/main -
  58. // currently I have not checked it for completeness - it does as much
  59. // as I need.
  60. type xlsxC struct {
  61. R string `xml:"r,attr"` // Cell ID, e.g. A1
  62. S int `xml:"s,attr"` // Style reference.
  63. T string `xml:"t,attr"` // Type.
  64. V string `xml:"v"` // Value
  65. }