style.go 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // xslx is a package designed to help with reading data from
  2. // spreadsheets stored in the XLSX format used in recent versions of
  3. // Microsoft's Excel spreadsheet.
  4. //
  5. // For a concise example of how to use this library why not check out
  6. // the source for xlsx2csv here: https://github.com/tealeg/xlsx2csv
  7. package xlsx
  8. // xlsxStyle directly maps the style element in the namespace
  9. // http://schemas.openxmlformats.org/spreadsheetml/2006/main -
  10. // currently I have not checked it for completeness - it does as much
  11. // as I need.
  12. type xlsxStyles struct {
  13. Fonts []xlsxFont `xml:"fonts>font"`
  14. Fills []xlsxFill `xml:"fills>fill"`
  15. Borders []xlsxBorder `xml:"borders>border"`
  16. CellStyleXfs []xlsxXf `xml:"cellStyleXfs>xf"`
  17. CellXfs []xlsxXf `xml:"cellXfs>xf"`
  18. }
  19. // xlsxFont directly maps the font element in the namespace
  20. // http://schemas.openxmlformats.org/spreadsheetml/2006/main -
  21. // currently I have not checked it for completeness - it does as much
  22. // as I need.
  23. type xlsxFont struct {
  24. Sz xlsxVal `xml:"sz"`
  25. Name xlsxVal `xml:"name"`
  26. Family xlsxVal `xml:"family"`
  27. Charset xlsxVal `xml:"charset"`
  28. }
  29. // xlsxVal directly maps the val element in the namespace
  30. // http://schemas.openxmlformats.org/spreadsheetml/2006/main -
  31. // currently I have not checked it for completeness - it does as much
  32. // as I need.
  33. type xlsxVal struct {
  34. Val string `xml:"val,attr"`
  35. }
  36. // xlsxFill directly maps the fill element in the namespace
  37. // http://schemas.openxmlformats.org/spreadsheetml/2006/main -
  38. // currently I have not checked it for completeness - it does as much
  39. // as I need.
  40. type xlsxFill struct {
  41. }
  42. // xlsxBorder directly maps the border element in the namespace
  43. // http://schemas.openxmlformats.org/spreadsheetml/2006/main -
  44. // currently I have not checked it for completeness - it does as much
  45. // as I need.
  46. type xlsxBorder struct {
  47. Left xlsxLine `xml:"left"`
  48. Right xlsxLine `xml:"right"`
  49. Top xlsxLine `xml:"top"`
  50. Bottom xlsxLine `xml:"bottom"`
  51. }
  52. // xlsxLine directly maps the line style element in the namespace
  53. // http://schemas.openxmlformats.org/spreadsheetml/2006/main -
  54. // currently I have not checked it for completeness - it does as much
  55. // as I need.
  56. type xlsxLine struct {
  57. Style string `xml:"style,attr"`
  58. }
  59. // xlsxXf directly maps the xf element in the namespace
  60. // http://schemas.openxmlformats.org/spreadsheetml/2006/main -
  61. // currently I have not checked it for completeness - it does as much
  62. // as I need.
  63. type xlsxXf struct {
  64. ApplyBorder string `xml:"applyBorder,attr"`
  65. BorderId int `xml:"borderId,attr"`
  66. }