├── codecov.yml ├── go.mod ├── _examples ├── preview.png ├── document │ ├── toc │ │ └── toc.docx │ ├── image │ │ ├── image.docx │ │ └── gophercolor.png │ ├── mail-merge │ │ ├── mm.docx │ │ └── main.go │ ├── simple │ │ ├── preview.png │ │ └── simple.docx │ ├── tables │ │ └── tables.docx │ ├── fill-out-form │ │ ├── form.docx │ │ └── filled-form.docx │ ├── hyperlink │ │ └── hyperlink.docx │ ├── doc-properties │ │ └── document.docx │ ├── edit-document │ │ ├── document.docx │ │ └── edit-document.docx │ ├── use-template │ │ ├── template.docx │ │ └── use-template.docx │ ├── header-footer │ │ ├── gophercolor.png │ │ └── header-footer.docx │ ├── line-spacing │ │ └── line-spacing.docx │ └── header-footer-multiple │ │ └── header-footer-multiple.docx ├── presentation │ ├── image │ │ ├── gopher.png │ │ ├── image.pptx │ │ ├── preview.png │ │ └── gophercolor.png │ ├── simple │ │ └── simple.pptx │ ├── complex │ │ ├── complex.pptx │ │ └── gophercolor.png │ └── use-template │ │ └── template.pptx └── spreadsheet │ ├── image │ ├── image.xlsx │ ├── preview.png │ └── gophercolor.png │ ├── borders │ └── borders.xlsx │ ├── complex │ ├── complex.xlsx │ └── preview.png │ ├── formula │ └── formula.xlsx │ ├── merged │ └── merged.xlsx │ ├── simple │ ├── simple.xlsx │ └── main.go │ ├── comments │ ├── comments.xlsx │ └── main.go │ ├── line-chart │ ├── preview.png │ └── line-chart.xlsx │ ├── bar-chart │ └── bar-chart.xlsx │ ├── line-chart-3d │ ├── preview.png │ └── line-chart-3d.xlsx │ ├── pie-chart │ └── pie-chart.xlsx │ ├── rich-text │ ├── rich-text.xlsx │ └── main.go │ ├── wrapped-text │ ├── wrapped.xlsx │ └── main.go │ ├── multiple-charts │ ├── preview.png │ └── multiple-chart.xlsx │ ├── rotated-cells │ ├── rotated.xlsx │ └── main.go │ ├── validation │ └── validation.xlsx │ ├── bubble-chart │ └── bubble-chart.xlsx │ ├── insert-rows │ ├── insert-rows.xlsx │ └── main.go │ ├── named-cells │ └── named-cells.xlsx │ ├── named-ranges │ └── named-ranges.xlsx │ ├── radar-chart │ └── radar-chart.xlsx │ ├── sort-filter │ ├── sort-filter.xlsx │ └── main.go │ ├── surface-chart │ └── surface-chart.xlsx │ ├── conditional-formatting │ ├── preview.png │ └── conditional-formatting.xlsx │ ├── freeze-rows-cols │ ├── freeze-rows-cols.xlsx │ └── main.go │ ├── line-chart-no-data │ └── line-chart-no-data.xlsx │ ├── number-date-time-formats │ └── number-date-time-formats.xlsx │ └── shared-formula │ └── main.go ├── cmd ├── docx2md │ └── markdown.docx └── catdoc │ └── main.go ├── document ├── testdata │ ├── gopher.png │ ├── issue198.docx │ ├── simple-1.docx │ ├── gophercolor.png │ ├── issue198.docx.golden │ └── header-footer-multiple.docx ├── formfieldtype_string.go ├── doc.go ├── knownfields.go ├── settings_test.go ├── structuredocumenttag.go └── onoffvalue.go ├── spreadsheet ├── testdata │ ├── fmt.xlsx │ ├── comments.xlsx │ ├── simple-1.xlsx │ ├── simple-2.xlsx │ ├── ordered-sheets.xlsx │ ├── worksheet.xml │ └── workbook.xml ├── formula │ ├── testdata │ │ ├── MacExcel365.xlsx │ │ └── formulareference.xlsx │ ├── gen.sh │ ├── expression.go │ ├── resulttype_string.go │ ├── referencetype_string.go │ ├── binoptype_string.go │ ├── emptyexpr.go │ ├── error.go │ ├── fninformation.go │ ├── sheetprefixexpr.go │ ├── string.go │ ├── negate.go │ ├── bool.go │ ├── cellref.go │ ├── number.go │ ├── reference.go │ ├── constarrayexpr.go │ ├── invalidreferencecontext.go │ └── evaluator.go ├── format │ ├── gen.sh │ ├── lex.go │ ├── time.go │ ├── fmttype_string.go │ ├── doc.go │ └── isnumber_test.go ├── sortorder_string.go ├── sheet_bench_test.go ├── password_test.go ├── fills.go ├── table.go ├── richtext.go └── password.go ├── testdata ├── Office2013 │ ├── Word-Windows.docx │ ├── Excel-Windows.xlsx │ └── PowerPoint-Windows.pptx ├── Office2016 │ ├── Word-Windows.docx │ ├── Excel-Windows.xlsx │ └── PowerPoint-Windows.pptx └── settings.xml ├── common ├── doc.go ├── testdata │ ├── rels.xml │ └── core.xml └── theme.go ├── color ├── doc.go └── hex.go ├── update-godoc.sh ├── algo └── strings.go ├── .gitignore ├── mingo_18.go ├── .github └── workflows │ └── go.yml ├── .travis.yml ├── schema ├── soo │ ├── ofc │ │ ├── relationships │ │ │ └── common.go │ │ └── math │ │ │ ├── CT_D_test.go │ │ │ ├── CT_F_test.go │ │ │ ├── CT_M_test.go │ │ │ ├── CT_R_test.go │ │ │ ├── CT_MC_test.go │ │ │ ├── CT_MR_test.go │ │ │ └── OMath_test.go │ ├── dml │ │ ├── lockedCanvas │ │ │ └── common.go │ │ ├── picture │ │ │ └── common.go │ │ ├── Tbl_test.go │ │ ├── Blip_test.go │ │ ├── Theme_test.go │ │ ├── AG_Blob_test.go │ │ ├── CT_Blip_test.go │ │ ├── Graphic_test.go │ │ ├── CT_Angle_test.go │ │ ├── CT_Bevel_test.go │ │ ├── CT_Color_test.go │ │ ├── CT_Ratio_test.go │ │ ├── CT_Table_test.go │ │ ├── EG_Media_test.go │ │ └── chart │ │ │ ├── CT_Tx_test.go │ │ │ └── Chart_test.go │ ├── pml │ │ ├── Sld_test.go │ │ ├── CmLst_test.go │ │ ├── Notes_test.go │ │ ├── AG_Ole_test.go │ │ ├── CT_Rel_test.go │ │ ├── OleObj_test.go │ │ ├── TagLst_test.go │ │ └── ViewPr_test.go │ ├── sml │ │ ├── Sst_test.go │ │ ├── CT_I_test.go │ │ ├── CT_X_test.go │ │ ├── CT_Xf_test.go │ │ ├── Table_test.go │ │ ├── Users_test.go │ │ ├── CT_Col_test.go │ │ ├── CT_Dxf_test.go │ │ ├── CT_Map_test.go │ │ ├── CT_Mdx_test.go │ │ ├── CT_Row_test.go │ │ ├── CT_Rst_test.go │ │ ├── CT_Set_test.go │ │ ├── CT_Sst_test.go │ │ ├── CT_Cell_test.go │ │ ├── CT_Cfvo_test.go │ │ ├── CT_Cols_test.go │ │ ├── CT_DbPr_test.go │ │ ├── CT_Dxfs_test.go │ │ ├── CT_Fill_test.go │ │ ├── CT_Font_test.go │ │ ├── CT_Item_test.go │ │ ├── CT_Pane_test.go │ │ ├── CT_RElt_test.go │ │ ├── CT_Sets_test.go │ │ ├── Headers_test.go │ │ └── MapInfo_test.go │ ├── wml │ │ ├── Ftr_test.go │ │ ├── Hdr_test.go │ │ ├── CT_P_test.go │ │ ├── CT_R_test.go │ │ ├── CT_Br_test.go │ │ ├── CT_Em_test.go │ │ ├── CT_Jc_test.go │ │ ├── CT_Tc_test.go │ │ ├── Fonts_test.go │ │ ├── WdWgp_test.go │ │ ├── WdWpc_test.go │ │ ├── WdWsp_test.go │ │ ├── CT_Cnf_test.go │ │ ├── CT_Div_test.go │ │ ├── CT_Ind_test.go │ │ ├── CT_Lvl_test.go │ │ ├── CT_Num_test.go │ │ ├── CT_PPr_test.go │ │ ├── CT_RPr_test.go │ │ ├── CT_Rel_test.go │ │ ├── CT_Row_test.go │ │ ├── CT_Shd_test.go │ │ ├── CT_Sym_test.go │ │ ├── CT_Tbl_test.go │ │ ├── EG_RPr_test.go │ │ ├── Styles_test.go │ │ ├── CT_Attr_test.go │ │ ├── CT_Body_test.go │ │ ├── CT_Divs_test.go │ │ ├── CT_Font_test.go │ │ ├── CT_Guid_test.go │ │ ├── CT_Lang_test.go │ │ ├── CT_Lock_test.go │ │ ├── CT_Odso_test.go │ │ ├── CT_PBdr_test.go │ │ ├── CT_PTab_test.go │ │ ├── CT_Perm_test.go │ │ ├── CT_Ruby_test.go │ │ ├── CT_Tabs_test.go │ │ ├── CT_TcPr_test.go │ │ ├── CT_Text_test.go │ │ ├── CT_TrPr_test.go │ │ ├── CT_View_test.go │ │ └── CT_Zoom_test.go │ └── schemaLibrary │ │ └── common.go └── purl.org │ └── dc │ ├── elements │ └── common.go │ └── terms │ ├── Box_test.go │ ├── DDC_test.go │ ├── IMT_test.go │ ├── LCC_test.go │ ├── TGN_test.go │ ├── UDC_test.go │ ├── URI_test.go │ ├── LCSH_test.go │ └── MESH_test.go ├── licensetype_string.go ├── license_test.go ├── test-coverage.sh ├── chart ├── axis_test.go ├── axis.go ├── gridlines.go └── seriesaxis.go ├── version.go ├── mingo.go ├── example_test.go ├── presentation ├── dml_test.go ├── image.go ├── slidelayout.go └── open.go ├── update-version.sh ├── zippkg └── helpers_test.go └── log.go /codecov.yml: -------------------------------------------------------------------------------- 1 | ignore: 2 | - ".*/schema/.*" -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/carmel/gooxml 2 | 3 | go 1.13 4 | -------------------------------------------------------------------------------- /_examples/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/preview.png -------------------------------------------------------------------------------- /cmd/docx2md/markdown.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/cmd/docx2md/markdown.docx -------------------------------------------------------------------------------- /document/testdata/gopher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/document/testdata/gopher.png -------------------------------------------------------------------------------- /spreadsheet/testdata/fmt.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/spreadsheet/testdata/fmt.xlsx -------------------------------------------------------------------------------- /_examples/document/toc/toc.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/document/toc/toc.docx -------------------------------------------------------------------------------- /document/testdata/issue198.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/document/testdata/issue198.docx -------------------------------------------------------------------------------- /document/testdata/simple-1.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/document/testdata/simple-1.docx -------------------------------------------------------------------------------- /document/testdata/gophercolor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/document/testdata/gophercolor.png -------------------------------------------------------------------------------- /spreadsheet/testdata/comments.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/spreadsheet/testdata/comments.xlsx -------------------------------------------------------------------------------- /spreadsheet/testdata/simple-1.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/spreadsheet/testdata/simple-1.xlsx -------------------------------------------------------------------------------- /spreadsheet/testdata/simple-2.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/spreadsheet/testdata/simple-2.xlsx -------------------------------------------------------------------------------- /_examples/document/image/image.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/document/image/image.docx -------------------------------------------------------------------------------- /_examples/document/mail-merge/mm.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/document/mail-merge/mm.docx -------------------------------------------------------------------------------- /_examples/document/simple/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/document/simple/preview.png -------------------------------------------------------------------------------- /_examples/document/simple/simple.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/document/simple/simple.docx -------------------------------------------------------------------------------- /_examples/document/tables/tables.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/document/tables/tables.docx -------------------------------------------------------------------------------- /testdata/Office2013/Word-Windows.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/testdata/Office2013/Word-Windows.docx -------------------------------------------------------------------------------- /testdata/Office2016/Word-Windows.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/testdata/Office2016/Word-Windows.docx -------------------------------------------------------------------------------- /_examples/presentation/image/gopher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/presentation/image/gopher.png -------------------------------------------------------------------------------- /_examples/presentation/image/image.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/presentation/image/image.pptx -------------------------------------------------------------------------------- /_examples/spreadsheet/image/image.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/image/image.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/image/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/image/preview.png -------------------------------------------------------------------------------- /document/testdata/issue198.docx.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/document/testdata/issue198.docx.golden -------------------------------------------------------------------------------- /testdata/Office2013/Excel-Windows.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/testdata/Office2013/Excel-Windows.xlsx -------------------------------------------------------------------------------- /testdata/Office2016/Excel-Windows.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/testdata/Office2016/Excel-Windows.xlsx -------------------------------------------------------------------------------- /_examples/document/fill-out-form/form.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/document/fill-out-form/form.docx -------------------------------------------------------------------------------- /_examples/document/image/gophercolor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/document/image/gophercolor.png -------------------------------------------------------------------------------- /_examples/presentation/image/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/presentation/image/preview.png -------------------------------------------------------------------------------- /_examples/presentation/simple/simple.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/presentation/simple/simple.pptx -------------------------------------------------------------------------------- /_examples/spreadsheet/borders/borders.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/borders/borders.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/complex/complex.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/complex/complex.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/complex/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/complex/preview.png -------------------------------------------------------------------------------- /_examples/spreadsheet/formula/formula.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/formula/formula.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/merged/merged.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/merged/merged.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/simple/simple.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/simple/simple.xlsx -------------------------------------------------------------------------------- /spreadsheet/testdata/ordered-sheets.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/spreadsheet/testdata/ordered-sheets.xlsx -------------------------------------------------------------------------------- /_examples/document/hyperlink/hyperlink.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/document/hyperlink/hyperlink.docx -------------------------------------------------------------------------------- /_examples/presentation/complex/complex.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/presentation/complex/complex.pptx -------------------------------------------------------------------------------- /_examples/presentation/image/gophercolor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/presentation/image/gophercolor.png -------------------------------------------------------------------------------- /_examples/spreadsheet/comments/comments.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/comments/comments.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/image/gophercolor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/image/gophercolor.png -------------------------------------------------------------------------------- /_examples/spreadsheet/line-chart/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/line-chart/preview.png -------------------------------------------------------------------------------- /testdata/Office2013/PowerPoint-Windows.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/testdata/Office2013/PowerPoint-Windows.pptx -------------------------------------------------------------------------------- /testdata/Office2016/PowerPoint-Windows.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/testdata/Office2016/PowerPoint-Windows.pptx -------------------------------------------------------------------------------- /_examples/document/doc-properties/document.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/document/doc-properties/document.docx -------------------------------------------------------------------------------- /_examples/document/edit-document/document.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/document/edit-document/document.docx -------------------------------------------------------------------------------- /_examples/document/use-template/template.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/document/use-template/template.docx -------------------------------------------------------------------------------- /_examples/presentation/complex/gophercolor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/presentation/complex/gophercolor.png -------------------------------------------------------------------------------- /_examples/spreadsheet/bar-chart/bar-chart.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/bar-chart/bar-chart.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/line-chart-3d/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/line-chart-3d/preview.png -------------------------------------------------------------------------------- /_examples/spreadsheet/pie-chart/pie-chart.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/pie-chart/pie-chart.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/rich-text/rich-text.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/rich-text/rich-text.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/wrapped-text/wrapped.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/wrapped-text/wrapped.xlsx -------------------------------------------------------------------------------- /common/doc.go: -------------------------------------------------------------------------------- 1 | // Package common contains wrapper types and utilities common to all of the 2 | // OOXML document formats. 3 | package common 4 | -------------------------------------------------------------------------------- /document/testdata/header-footer-multiple.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/document/testdata/header-footer-multiple.docx -------------------------------------------------------------------------------- /spreadsheet/formula/testdata/MacExcel365.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/spreadsheet/formula/testdata/MacExcel365.xlsx -------------------------------------------------------------------------------- /_examples/document/fill-out-form/filled-form.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/document/fill-out-form/filled-form.docx -------------------------------------------------------------------------------- /_examples/document/header-footer/gophercolor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/document/header-footer/gophercolor.png -------------------------------------------------------------------------------- /_examples/document/line-spacing/line-spacing.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/document/line-spacing/line-spacing.docx -------------------------------------------------------------------------------- /_examples/document/use-template/use-template.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/document/use-template/use-template.docx -------------------------------------------------------------------------------- /_examples/presentation/use-template/template.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/presentation/use-template/template.pptx -------------------------------------------------------------------------------- /_examples/spreadsheet/line-chart/line-chart.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/line-chart/line-chart.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/multiple-charts/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/multiple-charts/preview.png -------------------------------------------------------------------------------- /_examples/spreadsheet/rotated-cells/rotated.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/rotated-cells/rotated.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/validation/validation.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/validation/validation.xlsx -------------------------------------------------------------------------------- /_examples/document/edit-document/edit-document.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/document/edit-document/edit-document.docx -------------------------------------------------------------------------------- /_examples/document/header-footer/header-footer.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/document/header-footer/header-footer.docx -------------------------------------------------------------------------------- /_examples/spreadsheet/bubble-chart/bubble-chart.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/bubble-chart/bubble-chart.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/insert-rows/insert-rows.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/insert-rows/insert-rows.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/named-cells/named-cells.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/named-cells/named-cells.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/named-ranges/named-ranges.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/named-ranges/named-ranges.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/radar-chart/radar-chart.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/radar-chart/radar-chart.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/sort-filter/sort-filter.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/sort-filter/sort-filter.xlsx -------------------------------------------------------------------------------- /color/doc.go: -------------------------------------------------------------------------------- 1 | // Package color provides color handling structures and functions for use across 2 | // all of the document types. 3 | package color 4 | -------------------------------------------------------------------------------- /spreadsheet/formula/testdata/formulareference.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/spreadsheet/formula/testdata/formulareference.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/line-chart-3d/line-chart-3d.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/line-chart-3d/line-chart-3d.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/surface-chart/surface-chart.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/surface-chart/surface-chart.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/conditional-formatting/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/conditional-formatting/preview.png -------------------------------------------------------------------------------- /_examples/spreadsheet/multiple-charts/multiple-chart.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/multiple-charts/multiple-chart.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/freeze-rows-cols/freeze-rows-cols.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/freeze-rows-cols/freeze-rows-cols.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/line-chart-no-data/line-chart-no-data.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/line-chart-no-data/line-chart-no-data.xlsx -------------------------------------------------------------------------------- /spreadsheet/format/gen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "lexer" 3 | ragel -G2 -Z lexer.rl 4 | goimports -w lexer.go 5 | 6 | ragel -G2 -Z isnumber.rl 7 | goimports -w isnumber.go 8 | 9 | -------------------------------------------------------------------------------- /_examples/document/header-footer-multiple/header-footer-multiple.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/document/header-footer-multiple/header-footer-multiple.docx -------------------------------------------------------------------------------- /_examples/spreadsheet/conditional-formatting/conditional-formatting.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/conditional-formatting/conditional-formatting.xlsx -------------------------------------------------------------------------------- /_examples/spreadsheet/number-date-time-formats/number-date-time-formats.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carmel/gooxml/HEAD/_examples/spreadsheet/number-date-time-formats/number-date-time-formats.xlsx -------------------------------------------------------------------------------- /spreadsheet/formula/gen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "lexer" 3 | ragel -G0 -Z lexer.rl 4 | goimports -w lexer.go 5 | 6 | echo "parser" 7 | goyacc -l -o grammar.go grammar.y 8 | goimports -w grammar.go 9 | -------------------------------------------------------------------------------- /update-godoc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | for file in `find . -type d -not -ipath "*git*" -print`; do 3 | url=`echo $file | sed 's#^.#https://godoc.org/github.com/carmel/gooxml#'` 4 | echo $url 5 | curl -s $url -o /dev/null 6 | sleep 10 7 | done -------------------------------------------------------------------------------- /algo/strings.go: -------------------------------------------------------------------------------- 1 | package algo 2 | 3 | func RepeatString(s string, cnt int) string { 4 | if cnt <= 0 { 5 | return "" 6 | } 7 | buf := make([]byte, len(s)*cnt) 8 | sb := []byte(s) 9 | for i := 0; i < cnt; i++ { 10 | copy(buf[i:], sb) 11 | } 12 | return string(buf) 13 | } 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.dll 4 | *.so 5 | *.dylib 6 | *.swp 7 | coverage* 8 | **/.DS_Store 9 | **/main 10 | 11 | # Test binary, build with `go test -c` 12 | *.test 13 | 14 | **/.coverprofile 15 | gover.coverprofile 16 | spreadsheet/formula/y.output 17 | -------------------------------------------------------------------------------- /spreadsheet/format/lex.go: -------------------------------------------------------------------------------- 1 | package format 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | type Lexer struct { 8 | fmt Format 9 | formats []Format 10 | } 11 | 12 | func (l *Lexer) nextFmt() { 13 | l.formats = append(l.formats, l.fmt) 14 | l.fmt = Format{} 15 | } 16 | 17 | func Parse(s string) []Format { 18 | l := Lexer{} 19 | l.Lex(strings.NewReader(s)) 20 | l.formats = append(l.formats, l.fmt) 21 | return l.formats 22 | } 23 | -------------------------------------------------------------------------------- /mingo_18.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | // +build go1.8 9 | 10 | package gooxml 11 | 12 | const requires_go_18 = true 13 | -------------------------------------------------------------------------------- /.github/workflows/go.yml: -------------------------------------------------------------------------------- 1 | name: Go 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | 16 | - name: Set up Go 17 | uses: actions/setup-go@v2 18 | with: 19 | go-version: 1.17 20 | 21 | - name: Build 22 | run: go build -v ./... 23 | 24 | - name: Test 25 | run: go test -v ./... 26 | -------------------------------------------------------------------------------- /spreadsheet/sortorder_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=SortOrder"; DO NOT EDIT. 2 | 3 | package spreadsheet 4 | 5 | import "fmt" 6 | 7 | const _SortOrder_name = "SortOrderAscendingSortOrderDescending" 8 | 9 | var _SortOrder_index = [...]uint8{0, 18, 37} 10 | 11 | func (i SortOrder) String() string { 12 | if i >= SortOrder(len(_SortOrder_index)-1) { 13 | return fmt.Sprintf("SortOrder(%d)", i) 14 | } 15 | return _SortOrder_name[_SortOrder_index[i]:_SortOrder_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.8.x 4 | - 1.9.x 5 | - 1.10.x 6 | - 1.11 7 | 8 | install: 9 | - mkdir -p $HOME/gopath/src/baliance.com/ 10 | - ln -s $HOME/gopath/src/github.com/carmel/gooxml $HOME/gopath/src/baliance.com/gooxml 11 | 12 | script: 13 | - cd $HOME/gopath/src/baliance.com/gooxml 14 | - ./build-examples.sh 15 | - go vet ./... 16 | - go test ./... 17 | 18 | after_success: 19 | - ./test-coverage.sh 20 | -------------------------------------------------------------------------------- /schema/soo/ofc/relationships/common.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package relationships 11 | -------------------------------------------------------------------------------- /licensetype_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=LicenseType"; DO NOT EDIT. 2 | 3 | package gooxml 4 | 5 | import "fmt" 6 | 7 | const _LicenseType_name = "LicenseTypeInvalidLicenseTypeAGPLLicenseTypeCommercial" 8 | 9 | var _LicenseType_index = [...]uint8{0, 18, 33, 54} 10 | 11 | func (i LicenseType) String() string { 12 | if i >= LicenseType(len(_LicenseType_index)-1) { 13 | return fmt.Sprintf("LicenseType(%d)", i) 14 | } 15 | return _LicenseType_name[_LicenseType_index[i]:_LicenseType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /spreadsheet/sheet_bench_test.go: -------------------------------------------------------------------------------- 1 | package spreadsheet_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/carmel/gooxml/spreadsheet" 7 | ) 8 | 9 | func BenchmarkAddRow(b *testing.B) { 10 | ss := spreadsheet.New() 11 | sheet := ss.AddSheet() 12 | for r := 0; r < b.N; r++ { 13 | sheet.AddRow() 14 | } 15 | } 16 | 17 | func BenchmarkAddCell(b *testing.B) { 18 | ss := spreadsheet.New() 19 | sheet := ss.AddSheet() 20 | row := sheet.AddRow() 21 | 22 | for c := 0; c < b.N; c++ { 23 | row.AddCell() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /license_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package gooxml_test 9 | 10 | import "testing" 11 | import "github.com/carmel/gooxml" 12 | 13 | func TestOpenSourceLicense(t *testing.T) { 14 | gooxml.GetLicense() 15 | } 16 | -------------------------------------------------------------------------------- /spreadsheet/formula/expression.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package formula 9 | 10 | type Expression interface { 11 | Eval(ctx Context, ev Evaluator) Result 12 | Reference(ctx Context, ev Evaluator) Reference 13 | } 14 | -------------------------------------------------------------------------------- /document/formfieldtype_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=FormFieldType"; DO NOT EDIT. 2 | 3 | package document 4 | 5 | import "fmt" 6 | 7 | const _FormFieldType_name = "FormFieldTypeUnknownFormFieldTypeTextFormFieldTypeCheckBoxFormFieldTypeDropDown" 8 | 9 | var _FormFieldType_index = [...]uint8{0, 20, 37, 58, 79} 10 | 11 | func (i FormFieldType) String() string { 12 | if i >= FormFieldType(len(_FormFieldType_index)-1) { 13 | return fmt.Sprintf("FormFieldType(%d)", i) 14 | } 15 | return _FormFieldType_name[_FormFieldType_index[i]:_FormFieldType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /common/testdata/rels.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_examples/document/mail-merge/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | 6 | "github.com/carmel/gooxml/document" 7 | ) 8 | 9 | func main() { 10 | d, err := document.Open("mm.docx") 11 | if err != nil { 12 | log.Fatalf("error opening document: %s", err) 13 | } 14 | for _, v := range d.MergeFields() { 15 | log.Println("replacing", v) 16 | } 17 | rep := map[string]string{} 18 | rep["Title"] = "mr." // has a \* Upper attribute on the field 19 | rep["FirstName"] = "JOHN" // has a \* Lower attribute on the field 20 | d.MailMerge(rep) 21 | d.SaveToFile("merged.docx") 22 | } 23 | -------------------------------------------------------------------------------- /spreadsheet/formula/resulttype_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=ResultType"; DO NOT EDIT. 2 | 3 | package formula 4 | 5 | import "fmt" 6 | 7 | const _ResultType_name = "ResultTypeUnknownResultTypeNumberResultTypeStringResultTypeListResultTypeArrayResultTypeErrorResultTypeEmpty" 8 | 9 | var _ResultType_index = [...]uint8{0, 17, 33, 49, 63, 78, 93, 108} 10 | 11 | func (i ResultType) String() string { 12 | if i >= ResultType(len(_ResultType_index)-1) { 13 | return fmt.Sprintf("ResultType(%d)", i) 14 | } 15 | return _ResultType_name[_ResultType_index[i]:_ResultType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /spreadsheet/formula/referencetype_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=ReferenceType"; DO NOT EDIT. 2 | 3 | package formula 4 | 5 | import "fmt" 6 | 7 | const _ReferenceType_name = "ReferenceTypeInvalidReferenceTypeCellReferenceTypeNamedRangeReferenceTypeRangeReferenceTypeSheet" 8 | 9 | var _ReferenceType_index = [...]uint8{0, 20, 37, 60, 78, 96} 10 | 11 | func (i ReferenceType) String() string { 12 | if i >= ReferenceType(len(_ReferenceType_index)-1) { 13 | return fmt.Sprintf("ReferenceType(%d)", i) 14 | } 15 | return _ReferenceType_name[_ReferenceType_index[i]:_ReferenceType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /test-coverage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | PKG=github.com/carmel/gooxml 3 | ALLPKGS=`go list $PKG/... | grep -iv schema` 4 | 5 | cd $GOPATH/src/$PKG 6 | echo "Prebuilding" 7 | go build -i $PKG/... 8 | go test -i $PKG/... 9 | 10 | echo -e "mode: atomic" > coverage.txt 11 | echo "Running tests" 12 | for pkg in $ALLPKGS; do 13 | echo $pkg 14 | go test -coverprofile=coverprofile -covermode=atomic $pkg 15 | if [ -f coverprofile ]; then 16 | tail -n+2 coverprofile >> coverage.txt 17 | rm coverprofile 18 | fi 19 | done 20 | rm coverage.out coverage.txte 21 | bash <(curl -s https://codecov.io/bash) 22 | -------------------------------------------------------------------------------- /spreadsheet/format/time.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package format 9 | 10 | import "time" 11 | 12 | func asLocal(d time.Time) time.Time { 13 | d = d.UTC() 14 | return time.Date(d.Year(), d.Month(), d.Day(), d.Hour(), 15 | d.Minute(), d.Second(), d.Nanosecond(), time.Local) 16 | } 17 | -------------------------------------------------------------------------------- /cmd/catdoc/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | 3 | package main 4 | 5 | import ( 6 | "flag" 7 | "fmt" 8 | "log" 9 | 10 | "github.com/carmel/gooxml/document" 11 | ) 12 | 13 | func main() { 14 | flag.Parse() 15 | if flag.NArg() != 1 { 16 | log.Fatalf("pass a single document as a parameter") 17 | } 18 | doc, err := document.Open(flag.Arg(0)) 19 | if err != nil { 20 | log.Fatalf("error opening: %s", err) 21 | } 22 | for _, para := range doc.Paragraphs() { 23 | for _, run := range para.Runs() { 24 | if s := run.Text(); s != "" { 25 | fmt.Print(run.Text()) 26 | } 27 | } 28 | fmt.Println() 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /_examples/spreadsheet/comments/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | package main 3 | 4 | import ( 5 | "log" 6 | 7 | "github.com/carmel/gooxml/spreadsheet" 8 | ) 9 | 10 | func main() { 11 | ss := spreadsheet.New() 12 | sheet := ss.AddSheet() 13 | 14 | sheet.Cell("A1").SetString("Hello World!") 15 | sheet.Comments().AddCommentWithStyle("A1", "Gopher", "This looks interesting.") 16 | sheet.Comments().AddCommentWithStyle("C10", "Gopher", "This is a different comment.") 17 | 18 | if err := ss.Validate(); err != nil { 19 | log.Fatalf("error validating sheet: %s", err) 20 | } 21 | 22 | ss.SaveToFile("comments.xlsx") 23 | } 24 | -------------------------------------------------------------------------------- /spreadsheet/format/fmttype_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=FmtType"; DO NOT EDIT. 2 | 3 | package format 4 | 5 | import "fmt" 6 | 7 | const _FmtType_name = "FmtTypeLiteralFmtTypeDigitFmtTypeDigitOptFmtTypeCommaFmtTypeDecimalFmtTypePercentFmtTypeDollarFmtTypeDigitOptThousandsFmtTypeUnderscoreFmtTypeDateFmtTypeTimeFmtTypeFractionFmtTypeText" 8 | 9 | var _FmtType_index = [...]uint8{0, 14, 26, 41, 53, 67, 81, 94, 118, 135, 146, 157, 172, 183} 10 | 11 | func (i FmtType) String() string { 12 | if i >= FmtType(len(_FmtType_index)-1) { 13 | return fmt.Sprintf("FmtType(%d)", i) 14 | } 15 | return _FmtType_name[_FmtType_index[i]:_FmtType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /spreadsheet/formula/binoptype_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=BinOpType"; DO NOT EDIT. 2 | 3 | package formula 4 | 5 | import "fmt" 6 | 7 | const _BinOpType_name = "BinOpTypeUnknownBinOpTypePlusBinOpTypeMinusBinOpTypeMultBinOpTypeDivBinOpTypeExpBinOpTypeLTBinOpTypeGTBinOpTypeEQBinOpTypeLEQBinOpTypeGEQBinOpTypeNEBinOpTypeConcat" 8 | 9 | var _BinOpType_index = [...]uint8{0, 16, 29, 43, 56, 68, 80, 91, 102, 113, 125, 137, 148, 163} 10 | 11 | func (i BinOpType) String() string { 12 | if i >= BinOpType(len(_BinOpType_index)-1) { 13 | return fmt.Sprintf("BinOpType(%d)", i) 14 | } 15 | return _BinOpType_name[_BinOpType_index[i]:_BinOpType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /chart/axis_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package chart_test 9 | 10 | import ( 11 | "testing" 12 | 13 | "github.com/carmel/gooxml/chart" 14 | ) 15 | 16 | func TestNullAxis(t *testing.T) { 17 | if chart.NullAxis.AxisID() != 0 { 18 | t.Errorf("expected null axis to have ID 0, go %d", chart.NullAxis.AxisID()) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /version.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package gooxml 9 | 10 | import "time" 11 | 12 | // Release is the last release version of the software. 13 | var ReleaseVersion = "v0.8000" 14 | 15 | // ReleaseDate is the release date of the source code for licensing purposes. 16 | var ReleaseDate = time.Date(2018, 9, 14, 0, 0, 0, 0, time.UTC) 17 | -------------------------------------------------------------------------------- /_examples/spreadsheet/simple/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | package main 3 | 4 | import ( 5 | "fmt" 6 | "log" 7 | 8 | "github.com/carmel/gooxml/spreadsheet" 9 | ) 10 | 11 | func main() { 12 | ss := spreadsheet.New() 13 | // add a single sheet 14 | sheet := ss.AddSheet() 15 | 16 | // rows 17 | for r := 0; r < 5; r++ { 18 | row := sheet.AddRow() 19 | // and cells 20 | for c := 0; c < 5; c++ { 21 | cell := row.AddCell() 22 | cell.SetString(fmt.Sprintf("row %d cell %d", r, c)) 23 | } 24 | } 25 | 26 | if err := ss.Validate(); err != nil { 27 | log.Fatalf("error validating sheet: %s", err) 28 | } 29 | 30 | ss.SaveToFile("simple.xlsx") 31 | } 32 | -------------------------------------------------------------------------------- /document/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | /* 9 | 10 | Package document provides creation, reading, and writing of ECMA 376 Open 11 | Office XML documents. 12 | 13 | Example: 14 | 15 | doc := document.New() 16 | para := doc.AddParagraph() 17 | run := para.AddRun() 18 | run.SetText("foo") 19 | doc.SaveToFile("foo.docx") 20 | */ 21 | package document 22 | -------------------------------------------------------------------------------- /mingo.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package gooxml 9 | 10 | // MinGoVersion is used to cause a compile time error if gooxml is compiled with 11 | // an older version of go. Specifically it requires a feature in go 1.8 12 | // regarding collecting all attributes from arbitrary xml used in decode 13 | // gooxml.XSDAny. 14 | const MinGoVersion = requires_go_18 15 | -------------------------------------------------------------------------------- /chart/axis.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package chart 9 | 10 | // Axis is the interface implemented by different axes when assigning to a 11 | // chart. 12 | type Axis interface { 13 | AxisID() uint32 14 | } 15 | 16 | type nullAxis byte 17 | 18 | func (n nullAxis) AxisID() uint32 { 19 | return 0 20 | } 21 | 22 | // NullAxis is a null axis with an ID of zero 23 | var NullAxis Axis = nullAxis(0) 24 | -------------------------------------------------------------------------------- /spreadsheet/formula/emptyexpr.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package formula 9 | 10 | type EmptyExpr struct { 11 | } 12 | 13 | func NewEmptyExpr() Expression { 14 | return EmptyExpr{} 15 | } 16 | 17 | func (e EmptyExpr) Eval(ctx Context, ev Evaluator) Result { 18 | return MakeEmptyResult() 19 | } 20 | 21 | func (e EmptyExpr) Reference(ctx Context, ev Evaluator) Reference { 22 | return ReferenceInvalid 23 | } 24 | -------------------------------------------------------------------------------- /spreadsheet/formula/error.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package formula 9 | 10 | type Error struct { 11 | s string 12 | } 13 | 14 | func NewError(v string) Expression { 15 | return Error{v} 16 | } 17 | 18 | func (e Error) Eval(ctx Context, ev Evaluator) Result { 19 | return MakeErrorResult(e.s) 20 | } 21 | 22 | func (e Error) Reference(ctx Context, ev Evaluator) Reference { 23 | return ReferenceInvalid 24 | } 25 | -------------------------------------------------------------------------------- /example_test.go: -------------------------------------------------------------------------------- 1 | package gooxml_test 2 | 3 | import ( 4 | "github.com/carmel/gooxml/document" 5 | "github.com/carmel/gooxml/spreadsheet" 6 | ) 7 | 8 | func Example_document() { 9 | // see the github.com/carmel/gooxml/document documentation or _examples/document 10 | // for more examples 11 | doc := document.New() 12 | doc.AddParagraph().AddRun().AddText("Hello World!") 13 | doc.SaveToFile("document.docx") 14 | } 15 | 16 | func Example_spreadsheeet() { 17 | // see the github.com/carmel/gooxml/spreadsheet documentation or _examples/spreadsheet 18 | // for more examples 19 | ss := spreadsheet.New() 20 | sheet := ss.AddSheet() 21 | sheet.AddRow().AddCell().SetString("Hello") 22 | sheet.Cell("B1").SetString("World!") 23 | ss.SaveToFile("workbook.xlsx") 24 | } 25 | -------------------------------------------------------------------------------- /presentation/dml_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package presentation_test 9 | 10 | import ( 11 | "testing" 12 | 13 | "github.com/carmel/gooxml/schema/soo/dml" 14 | ) 15 | 16 | // Issue #207 17 | func TestParseUnionST_AdjCoordinate(t *testing.T) { 18 | // this crashed due to a null pointer dereferences when not initializing the 19 | // returned value correctly 20 | dml.ParseUnionST_AdjCoordinate("123") 21 | } 22 | -------------------------------------------------------------------------------- /spreadsheet/formula/fninformation.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package formula 9 | 10 | func init() { 11 | RegisterFunction("NA", NA) 12 | } 13 | 14 | // NA is an implementation of the Excel NA() function that just returns the #N/A! error. 15 | func NA(args []Result) Result { 16 | if len(args) != 0 { 17 | MakeErrorResult("NA() accepts no arguments") 18 | } 19 | return MakeErrorResultType(ErrorTypeNA, "") 20 | } 21 | -------------------------------------------------------------------------------- /common/theme.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package common 9 | 10 | import "github.com/carmel/gooxml/schema/soo/dml" 11 | 12 | // Theme is a drawingml theme. 13 | type Theme struct { 14 | x *dml.Theme 15 | } 16 | 17 | // NewTheme constructs a new theme. 18 | func NewTheme() Theme { 19 | return Theme{dml.NewTheme()} 20 | } 21 | 22 | // X returns the inner wrapped XML type. 23 | func (t Theme) X() *dml.Theme { 24 | return t.x 25 | } 26 | -------------------------------------------------------------------------------- /document/knownfields.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package document 9 | 10 | // Field constants 11 | const ( 12 | FieldCurrentPage = "PAGE" 13 | FieldNumberOfPages = "NUMPAGES" 14 | FieldDate = "DATE" 15 | FieldCreateDate = "CREATEDATE" 16 | FieldEditTime = "EDITTIME" 17 | FieldPrintDate = "PRINTDATE" 18 | FieldSaveDate = "SAVEDATE" 19 | FieldTIme = "TIME" 20 | FieldTOC = "TOC" 21 | ) 22 | -------------------------------------------------------------------------------- /color/hex.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package color 9 | 10 | import "fmt" 11 | 12 | func FromHex(s string) Color { 13 | if len(s) == 0 { 14 | return Auto 15 | } 16 | if s[0] == '#' { 17 | s = s[1:] 18 | } 19 | //func Sscanf(str string, format string, a ...interface{}) (n int, err error) { 20 | var r, g, b uint8 21 | n, _ := fmt.Sscanf(s, "%02x%02x%02x", &r, &g, &b) 22 | if n == 3 { 23 | return RGB(r, g, b) 24 | } 25 | return Auto 26 | } 27 | -------------------------------------------------------------------------------- /update-version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | cat << __EOF > version.go 5 | // Copyright `date +%Y` Baliance. All rights reserved. 6 | // 7 | // Use of this source code is governed by the terms of the Affero GNU General 8 | // Public License version 3.0 as published by the Free Software Foundation and 9 | // appearing in the file LICENSE included in the packaging of this file. A 10 | // commercial license can be purchased by contacting sales@baliance.com. 11 | 12 | package gooxml 13 | 14 | import "time" 15 | 16 | // Release is the last release version of the software. 17 | var ReleaseVersion = "v0.8000" 18 | 19 | // ReleaseDate is the release date of the source code for licensing purposes. 20 | var ReleaseDate = time.Date(`date +%Y`,`date +%_m`,`date +%_d`,0,0,0,0,time.UTC) 21 | 22 | __EOF 23 | goimports -w version.go 24 | -------------------------------------------------------------------------------- /schema/soo/dml/lockedCanvas/common.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package lockedCanvas 11 | 12 | import "github.com/carmel/gooxml" 13 | 14 | // init registers constructor functions for dynamically creating elements based off the XML namespace and name 15 | func init() { 16 | gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas", "lockedCanvas", NewLockedCanvas) 17 | } 18 | -------------------------------------------------------------------------------- /spreadsheet/format/doc.go: -------------------------------------------------------------------------------- 1 | // Package format provides support for parsing and evaluating 2 | // spreadsheetml/Excel number formats. 3 | // 4 | // Internally spreadsheets store numbers and dates values as a text 5 | // representation of a floating point number (e.g. 1.2345). This number is then 6 | // displayed in Excel or another spreadsheet viewer differently depending on the 7 | // number fornat of the cell style applied to the cell. 8 | // 9 | // As an example, the same value of 1.2345 can be displayed as: 10 | // - "1" with format "0" 11 | // - "1.2" with format "0.0" 12 | // - "1.23" with format "0.00" 13 | // - "1.235" with format "0.000" 14 | // - "123%" with format "0%" 15 | // - "1 23/100" with fornat "0 0/100" 16 | // - "1.23E+00" with format "0.00E+00" 17 | // - "29:37:41s" with format `[h]:mm:ss"s"` 18 | package format 19 | -------------------------------------------------------------------------------- /_examples/spreadsheet/wrapped-text/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | package main 3 | 4 | import ( 5 | "log" 6 | 7 | "github.com/carmel/gooxml/spreadsheet" 8 | ) 9 | 10 | var lorem = `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin lobortis, lectus dictum feugiat tempus, sem neque finibus enim, sed eleifend sem nunc ac diam. Vestibulum tempus sagittis elementum` 11 | 12 | func main() { 13 | ss := spreadsheet.New() 14 | // add a single sheet 15 | sheet := ss.AddSheet() 16 | 17 | row := sheet.AddRow() 18 | cell := row.AddCell() 19 | 20 | wrapped := ss.StyleSheet.AddCellStyle() 21 | wrapped.SetWrapped(true) 22 | cell.SetString(lorem) 23 | cell.SetStyle(wrapped) 24 | 25 | if err := ss.Validate(); err != nil { 26 | log.Fatalf("error validating sheet: %s", err) 27 | } 28 | 29 | ss.SaveToFile("wrapped.xlsx") 30 | } 31 | -------------------------------------------------------------------------------- /spreadsheet/testdata/worksheet.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_examples/spreadsheet/insert-rows/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | package main 3 | 4 | import ( 5 | "fmt" 6 | "log" 7 | 8 | "github.com/carmel/gooxml/spreadsheet" 9 | ) 10 | 11 | func main() { 12 | ss := spreadsheet.New() 13 | // add a single sheet 14 | sheet := ss.AddSheet() 15 | 16 | // rows 17 | for r := 0; r < 5; r++ { 18 | row := sheet.AddRow() 19 | // and cells 20 | for c := 0; c < 5; c++ { 21 | cell := row.AddCell() 22 | cell.SetString(fmt.Sprintf("row %d cell %d", r, c)) 23 | } 24 | } 25 | 26 | // no insert some rows after row 2 27 | for i := 0; i < 4; i++ { 28 | sheet.InsertRow(2).AddCell().SetString(fmt.Sprintf("inserted at 2, iter %d", i)) 29 | } 30 | 31 | if err := ss.Validate(); err != nil { 32 | log.Fatalf("error validating sheet: %s", err) 33 | } 34 | 35 | ss.SaveToFile("insert-rows.xlsx") 36 | } 37 | -------------------------------------------------------------------------------- /_examples/spreadsheet/rotated-cells/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | package main 3 | 4 | import ( 5 | "log" 6 | 7 | "github.com/carmel/gooxml/spreadsheet" 8 | ) 9 | 10 | var lorem = `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin lobortis, lectus dictum feugiat tempus, sem neque finibus enim, sed eleifend sem nunc ac diam. Vestibulum tempus sagittis elementum` 11 | 12 | func main() { 13 | ss := spreadsheet.New() 14 | // add a single sheet 15 | sheet := ss.AddSheet() 16 | 17 | row := sheet.AddRow() 18 | cell := row.AddCell() 19 | 20 | rotated := ss.StyleSheet.AddCellStyle() 21 | rotated.SetRotation(45) 22 | 23 | cell.SetString(lorem) 24 | cell.SetStyle(rotated) 25 | 26 | if err := ss.Validate(); err != nil { 27 | log.Fatalf("error validating sheet: %s", err) 28 | } 29 | 30 | ss.SaveToFile("rotated.xlsx") 31 | } 32 | -------------------------------------------------------------------------------- /spreadsheet/password_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package spreadsheet_test 9 | 10 | import ( 11 | "testing" 12 | 13 | "github.com/carmel/gooxml/spreadsheet" 14 | ) 15 | 16 | func TestKnownHashes(t *testing.T) { 17 | td := []struct { 18 | Inp string 19 | Exp string 20 | }{ 21 | {"gooxml", "DD67"}, 22 | {"", "0000"}, 23 | } 24 | for _, tc := range td { 25 | if got := spreadsheet.PasswordHash(tc.Inp); got != tc.Exp { 26 | t.Errorf("expected hash of %s = %s, got %s", tc.Inp, tc.Exp, got) 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /zippkg/helpers_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package zippkg_test 9 | 10 | import "testing" 11 | import "github.com/carmel/gooxml/zippkg" 12 | 13 | func TestRelsPathFor(t *testing.T) { 14 | td := []struct { 15 | Inp string 16 | Exp string 17 | }{{"/", "/_rels/.rels"}, 18 | {"/xl/workbook.xml", "/xl/_rels/workbook.xml.rels"}} 19 | for _, tc := range td { 20 | if got := zippkg.RelationsPathFor(tc.Inp); got != tc.Exp { 21 | t.Errorf("expected RelsPathFor(%s) = %s, got %s", tc.Inp, tc.Exp, got) 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /log.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package gooxml 9 | 10 | import ( 11 | "log" 12 | ) 13 | 14 | // Log is used to log content from within the library. The intent is to use 15 | // logging sparingly, preferring to return an error. At the very least this 16 | // allows redirecting logs to somewhere more appropriate than stdout. 17 | var Log = log.Printf 18 | 19 | // DisableLogging sets the Log function to a no-op so that any log messages are 20 | // silently discarded. 21 | func DisableLogging() { 22 | Log = func(string, ...interface{}) {} 23 | } 24 | -------------------------------------------------------------------------------- /spreadsheet/formula/sheetprefixexpr.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package formula 9 | 10 | type SheetPrefixExpr struct { 11 | sheet string 12 | } 13 | 14 | func NewSheetPrefixExpr(s string) Expression { 15 | return &SheetPrefixExpr{s} 16 | } 17 | 18 | func (s SheetPrefixExpr) Eval(ctx Context, ev Evaluator) Result { 19 | return MakeErrorResult("sheet prefix should never be evaluated") 20 | } 21 | 22 | func (s SheetPrefixExpr) Reference(ctx Context, ev Evaluator) Reference { 23 | return Reference{Type: ReferenceTypeSheet, Value: s.sheet} 24 | } 25 | -------------------------------------------------------------------------------- /spreadsheet/formula/string.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package formula 9 | 10 | import "strings" 11 | 12 | type String struct { 13 | s string 14 | } 15 | 16 | func NewString(v string) Expression { 17 | // Excel escapes quotes within a string by repeating them 18 | v = strings.Replace(v, `""`, `"`, -1) 19 | return String{v} 20 | } 21 | 22 | func (s String) Eval(ctx Context, ev Evaluator) Result { 23 | return MakeStringResult(s.s) 24 | } 25 | 26 | func (s String) Reference(ctx Context, ev Evaluator) Reference { 27 | return ReferenceInvalid 28 | } 29 | -------------------------------------------------------------------------------- /document/settings_test.go: -------------------------------------------------------------------------------- 1 | package document 2 | 3 | import ( 4 | "bytes" 5 | "encoding/xml" 6 | "fmt" 7 | "os" 8 | "testing" 9 | 10 | "github.com/carmel/gooxml/schema/soo/wml" 11 | "github.com/carmel/gooxml/testhelper" 12 | "github.com/carmel/gooxml/zippkg" 13 | ) 14 | 15 | func TestSettingsUnmarshal(t *testing.T) { 16 | f, err := os.Open("testdata/settings.xml") 17 | if err != nil { 18 | t.Fatalf("error reading settings file") 19 | } 20 | dec := xml.NewDecoder(f) 21 | stng := wml.NewSettings() 22 | if err := dec.Decode(stng); err != nil { 23 | t.Errorf("error decoding settings: %s", err) 24 | } 25 | got := &bytes.Buffer{} 26 | fmt.Fprintf(got, zippkg.XMLHeader) 27 | enc := xml.NewEncoder(zippkg.SelfClosingWriter{W: got}) 28 | if err := enc.Encode(stng); err != nil { 29 | t.Errorf("error encoding settings: %s", err) 30 | } 31 | 32 | testhelper.CompareGoldenXML(t, "settings.xml", got.Bytes()) 33 | } 34 | -------------------------------------------------------------------------------- /spreadsheet/formula/negate.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package formula 9 | 10 | type Negate struct { 11 | e Expression 12 | } 13 | 14 | func NewNegate(e Expression) Expression { 15 | return Negate{e} 16 | } 17 | 18 | func (n Negate) Eval(ctx Context, ev Evaluator) Result { 19 | r := n.e.Eval(ctx, ev) 20 | if r.Type == ResultTypeNumber { 21 | return MakeNumberResult(-r.ValueNumber) 22 | } 23 | return MakeErrorResult("NEGATE expected number argument") 24 | } 25 | 26 | func (n Negate) Reference(ctx Context, ev Evaluator) Reference { 27 | return ReferenceInvalid 28 | } 29 | -------------------------------------------------------------------------------- /spreadsheet/fills.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package spreadsheet 9 | 10 | import ( 11 | "github.com/carmel/gooxml" 12 | "github.com/carmel/gooxml/schema/soo/sml" 13 | ) 14 | 15 | type Fills struct { 16 | x *sml.CT_Fills 17 | } 18 | 19 | func NewFills() Fills { 20 | return Fills{sml.NewCT_Fills()} 21 | } 22 | 23 | func (f Fills) X() *sml.CT_Fills { 24 | return f.x 25 | } 26 | 27 | func (f Fills) AddFill() Fill { 28 | fill := sml.NewCT_Fill() 29 | f.x.Fill = append(f.x.Fill, fill) 30 | f.x.CountAttr = gooxml.Uint32(uint32(len(f.x.Fill))) 31 | return Fill{fill, f.x} 32 | } 33 | -------------------------------------------------------------------------------- /presentation/image.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package presentation 9 | 10 | import ( 11 | "github.com/carmel/gooxml/drawing" 12 | "github.com/carmel/gooxml/schema/soo/dml" 13 | "github.com/carmel/gooxml/schema/soo/pml" 14 | ) 15 | 16 | // Image is an image within a slide. 17 | type Image struct { 18 | x *pml.CT_Picture 19 | } 20 | 21 | // Properties returns the properties of the TextBox. 22 | func (i Image) Properties() drawing.ShapeProperties { 23 | if i.x.SpPr == nil { 24 | i.x.SpPr = dml.NewCT_ShapeProperties() 25 | } 26 | return drawing.MakeShapeProperties(i.x.SpPr) 27 | } 28 | -------------------------------------------------------------------------------- /spreadsheet/testdata/workbook.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /testdata/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /spreadsheet/formula/bool.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package formula 9 | 10 | import ( 11 | "strconv" 12 | 13 | "github.com/carmel/gooxml" 14 | ) 15 | 16 | type Bool struct { 17 | b bool 18 | } 19 | 20 | func NewBool(v string) Expression { 21 | b, err := strconv.ParseBool(v) 22 | if err != nil { 23 | gooxml.Log("error parsing formula bool %s: %s", v, err) 24 | } 25 | return Bool{b} 26 | } 27 | 28 | func (b Bool) Eval(ctx Context, ev Evaluator) Result { 29 | return MakeBoolResult(b.b) 30 | } 31 | 32 | func (b Bool) Reference(ctx Context, ev Evaluator) Reference { 33 | return ReferenceInvalid 34 | } 35 | -------------------------------------------------------------------------------- /spreadsheet/table.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package spreadsheet 9 | 10 | import "github.com/carmel/gooxml/schema/soo/sml" 11 | 12 | type Table struct { 13 | x *sml.Table 14 | } 15 | 16 | // X returns the inner wrapped XML type. 17 | func (t Table) X() *sml.Table { 18 | return t.x 19 | } 20 | 21 | // Name returns the name of the table 22 | func (t Table) Name() string { 23 | if t.x.NameAttr != nil { 24 | return *t.x.NameAttr 25 | } 26 | return "" 27 | } 28 | 29 | // Reference returns the table reference (the cells within the table) 30 | func (t Table) Reference() string { 31 | return t.x.RefAttr 32 | } 33 | -------------------------------------------------------------------------------- /spreadsheet/formula/cellref.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package formula 9 | 10 | // CellRef is a reference to a single cell 11 | type CellRef struct { 12 | s string 13 | } 14 | 15 | // NewCellRef constructs a new cell reference. 16 | func NewCellRef(v string) Expression { 17 | return CellRef{v} 18 | } 19 | 20 | // Eval evaluates and returns the result of the cell reference. 21 | func (c CellRef) Eval(ctx Context, ev Evaluator) Result { 22 | return ctx.Cell(c.s, ev) 23 | } 24 | 25 | func (c CellRef) Reference(ctx Context, ev Evaluator) Reference { 26 | return Reference{Type: ReferenceTypeCell, Value: c.s} 27 | } 28 | -------------------------------------------------------------------------------- /chart/gridlines.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package chart 9 | 10 | import ( 11 | "github.com/carmel/gooxml/drawing" 12 | "github.com/carmel/gooxml/schema/soo/dml" 13 | crt "github.com/carmel/gooxml/schema/soo/dml/chart" 14 | ) 15 | 16 | type GridLines struct { 17 | x *crt.CT_ChartLines 18 | } 19 | 20 | // X returns the inner wrapped XML type. 21 | func (g GridLines) X() *crt.CT_ChartLines { 22 | return g.x 23 | } 24 | 25 | func (g GridLines) Properties() drawing.ShapeProperties { 26 | if g.x.SpPr == nil { 27 | g.x.SpPr = dml.NewCT_ShapeProperties() 28 | } 29 | return drawing.MakeShapeProperties(g.x.SpPr) 30 | } 31 | -------------------------------------------------------------------------------- /common/testdata/core.xml: -------------------------------------------------------------------------------- 1 | 2017-08-21T12:10:00Z2017-08-21T12:11:00Z1 -------------------------------------------------------------------------------- /spreadsheet/formula/number.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package formula 9 | 10 | import ( 11 | "strconv" 12 | 13 | "github.com/carmel/gooxml" 14 | ) 15 | 16 | type Number struct { 17 | v float64 18 | } 19 | 20 | func NewNumber(v string) Expression { 21 | f, err := strconv.ParseFloat(v, 64) 22 | if err != nil { 23 | gooxml.Log("error parsing formula number %s: %s", v, err) 24 | } 25 | return Number{f} 26 | } 27 | 28 | func (n Number) Eval(ctx Context, ev Evaluator) Result { 29 | return MakeNumberResult(n.v) 30 | } 31 | 32 | func (n Number) Reference(ctx Context, ev Evaluator) Reference { 33 | return ReferenceInvalid 34 | } 35 | -------------------------------------------------------------------------------- /document/structuredocumenttag.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package document 9 | 10 | import "github.com/carmel/gooxml/schema/soo/wml" 11 | 12 | // StructuredDocumentTag are a tagged bit of content in a document. 13 | type StructuredDocumentTag struct { 14 | d *Document 15 | x *wml.CT_SdtBlock 16 | } 17 | 18 | // Paragraphs returns the paragraphs within a structured document tag. 19 | func (s StructuredDocumentTag) Paragraphs() []Paragraph { 20 | if s.x.SdtContent == nil { 21 | return nil 22 | } 23 | ret := []Paragraph{} 24 | for _, p := range s.x.SdtContent.P { 25 | ret = append(ret, Paragraph{s.d, p}) 26 | } 27 | return ret 28 | } 29 | -------------------------------------------------------------------------------- /chart/seriesaxis.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package chart 9 | 10 | import crt "github.com/carmel/gooxml/schema/soo/dml/chart" 11 | 12 | type SeriesAxis struct { 13 | x *crt.CT_SerAx 14 | } 15 | 16 | func MakeSeriesAxis(x *crt.CT_SerAx) SeriesAxis { 17 | return SeriesAxis{x} 18 | } 19 | 20 | // X returns the inner wrapped XML type. 21 | func (s SeriesAxis) X() *crt.CT_SerAx { 22 | return s.x 23 | } 24 | 25 | func (s SeriesAxis) InitializeDefaults() { 26 | 27 | } 28 | 29 | func (s SeriesAxis) AxisID() uint32 { 30 | return s.x.AxId.ValAttr 31 | } 32 | 33 | func (s SeriesAxis) SetCrosses(axis Axis) { 34 | s.x.CrossAx.ValAttr = axis.AxisID() 35 | } 36 | -------------------------------------------------------------------------------- /spreadsheet/formula/reference.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package formula 9 | 10 | // ReferenceType is a type of reference 11 | //go:generate stringer -type=ReferenceType 12 | type ReferenceType byte 13 | 14 | const ( 15 | ReferenceTypeInvalid ReferenceType = iota 16 | ReferenceTypeCell 17 | ReferenceTypeNamedRange 18 | ReferenceTypeRange 19 | ReferenceTypeSheet 20 | ) 21 | 22 | type Reference struct { 23 | Type ReferenceType 24 | Value string 25 | } 26 | 27 | var ReferenceInvalid = Reference{Type: ReferenceTypeInvalid} 28 | 29 | func MakeRangeReference(ref string) Reference { 30 | return Reference{Type: ReferenceTypeRange, Value: ref} 31 | } 32 | -------------------------------------------------------------------------------- /spreadsheet/richtext.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package spreadsheet 9 | 10 | import "github.com/carmel/gooxml/schema/soo/sml" 11 | 12 | // RichText is a container for the rich text within a cell. It's similar to a 13 | // paragaraph for a document, except a cell can only contain one rich text item. 14 | type RichText struct { 15 | x *sml.CT_Rst 16 | } 17 | 18 | // X returns the inner wrapped XML type. 19 | func (r RichText) X() *sml.CT_Rst { 20 | return r.x 21 | } 22 | 23 | // AddRun adds a new run of text to the cell. 24 | func (r RichText) AddRun() RichTextRun { 25 | elt := sml.NewCT_RElt() 26 | r.x.R = append(r.x.R, elt) 27 | return RichTextRun{elt} 28 | } 29 | -------------------------------------------------------------------------------- /_examples/spreadsheet/sort-filter/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | package main 3 | 4 | import ( 5 | "fmt" 6 | "log" 7 | 8 | "github.com/carmel/gooxml/spreadsheet" 9 | ) 10 | 11 | func main() { 12 | ss := spreadsheet.New() 13 | // add a single sheet 14 | sheet := ss.AddSheet() 15 | hdrRow := sheet.AddRow() 16 | hdrRow.AddCell().SetString("Product Name") 17 | hdrRow.AddCell().SetString("Quantity") 18 | hdrRow.AddCell().SetString("Price") 19 | sheet.SetAutoFilter("A1:C6") 20 | 21 | // rows 22 | for r := 0; r < 5; r++ { 23 | row := sheet.AddRow() 24 | row.AddCell().SetString(fmt.Sprintf("Product %d", r+1)) 25 | row.AddCell().SetNumber(float64(r + 2)) 26 | row.AddCell().SetNumber(float64(3*r + 1)) 27 | 28 | } 29 | 30 | // sort column C, starting a row 2 to skip the header row 31 | sheet.Sort("C", 2, spreadsheet.SortOrderDescending) 32 | 33 | if err := ss.Validate(); err != nil { 34 | log.Fatalf("error validating sheet: %s", err) 35 | } 36 | 37 | ss.SaveToFile("sort-filter.xlsx") 38 | } 39 | -------------------------------------------------------------------------------- /schema/soo/dml/picture/common.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package picture 11 | 12 | import "github.com/carmel/gooxml" 13 | 14 | // init registers constructor functions for dynamically creating elements based off the XML namespace and name 15 | func init() { 16 | gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/picture", "CT_PictureNonVisual", NewCT_PictureNonVisual) 17 | gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/picture", "CT_Picture", NewCT_Picture) 18 | gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/picture", "pic", NewPic) 19 | } 20 | -------------------------------------------------------------------------------- /spreadsheet/formula/constarrayexpr.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package formula 9 | 10 | type ConstArrayExpr struct { 11 | data [][]Expression 12 | } 13 | 14 | func NewConstArrayExpr(data [][]Expression) Expression { 15 | return &ConstArrayExpr{data} 16 | } 17 | 18 | func (c ConstArrayExpr) Eval(ctx Context, ev Evaluator) Result { 19 | res := [][]Result{} 20 | for _, row := range c.data { 21 | r := []Result{} 22 | for _, col := range row { 23 | r = append(r, col.Eval(ctx, ev)) 24 | } 25 | res = append(res, r) 26 | } 27 | return MakeArrayResult(res) 28 | } 29 | 30 | func (c ConstArrayExpr) Reference(ctx Context, ev Evaluator) Reference { 31 | return ReferenceInvalid 32 | } 33 | -------------------------------------------------------------------------------- /spreadsheet/password.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package spreadsheet 9 | 10 | import ( 11 | "fmt" 12 | ) 13 | 14 | // PasswordHash returns the password hash for a workbook using the modified 15 | // spreadsheetML password hash that is compatible with Excel. 16 | func PasswordHash(s string) string { 17 | hash := uint16(0) 18 | if len(s) > 0 { 19 | for i := len(s) - 1; i >= 0; i-- { 20 | c := s[i] 21 | hash = ((hash >> 14) & 0x01) | ((hash << 1) & 0x7fff) 22 | hash ^= uint16(c) 23 | } 24 | hash = ((hash >> 14) & 0x01) | ((hash << 1) & 0x7fff) 25 | hash ^= uint16(len(s)) 26 | hash ^= (0x8000 | ('N' << 8) | 'K') 27 | } 28 | return fmt.Sprintf("%04X", uint64(hash)) 29 | } 30 | -------------------------------------------------------------------------------- /_examples/spreadsheet/freeze-rows-cols/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | package main 3 | 4 | import ( 5 | "log" 6 | "math/rand" 7 | 8 | "github.com/carmel/gooxml/spreadsheet" 9 | ) 10 | 11 | func main() { 12 | ss := spreadsheet.New() 13 | sheet := ss.AddSheet() 14 | 15 | row := sheet.AddRow() 16 | row.AddCell() 17 | for i := 0; i < 99; i++ { 18 | row.AddCell().SetString("Header") 19 | } 20 | for i := 0; i < 100; i++ { 21 | row = sheet.AddRow() 22 | row.AddCell().SetString("Header") 23 | for j := 0; j < 99; j++ { 24 | row.AddCell().SetNumber(rand.Float64() * 100) 25 | } 26 | } 27 | 28 | // freeze the first row and column 29 | sheet.SetFrozen(true, true) 30 | 31 | /* this is equivalent to 32 | v := sheet.InitialView() 33 | v.SetState(sml.ST_PaneStateFrozen) 34 | v.SetYSplit(1) 35 | v.SetXSplit(1) 36 | v.SetTopLeft("B2") 37 | */ 38 | 39 | if err := ss.Validate(); err != nil { 40 | log.Fatalf("error validating sheet: %s", err) 41 | } 42 | 43 | ss.SaveToFile("freeze-rows-cols.xlsx") 44 | } 45 | -------------------------------------------------------------------------------- /_examples/spreadsheet/shared-formula/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | package main 3 | 4 | import ( 5 | "log" 6 | 7 | "github.com/carmel/gooxml/spreadsheet" 8 | ) 9 | 10 | func main() { 11 | ss := spreadsheet.New() 12 | sheet := ss.AddSheet() 13 | 14 | sheet.Cell("A1").SetNumber(1) 15 | sheet.Cell("B1").SetNumber(2) 16 | sheet.Cell("C1").SetNumber(3) 17 | sheet.Cell("D1").SetNumber(4) 18 | sheet.Cell("A2").SetNumber(5) 19 | sheet.Cell("B2").SetNumber(6) 20 | sheet.Cell("C2").SetNumber(7) 21 | sheet.Cell("D2").SetNumber(8) 22 | sheet.Cell("A3").SetNumber(9) 23 | sheet.Cell("B3").SetNumber(10) 24 | sheet.Cell("C3").SetNumber(11) 25 | sheet.Cell("D3").SetNumber(12) 26 | 27 | sheet.Cell("A5").SetFormulaShared("A1+1", 2, 3) 28 | sheet.Cell("A9").SetFormulaShared("$A1+1", 2, 3) 29 | sheet.Cell("A13").SetFormulaShared("$A$1+1", 2, 3) 30 | 31 | ss.RecalculateFormulas() 32 | if err := ss.Validate(); err != nil { 33 | log.Fatalf("error validating: %s", err) 34 | } 35 | ss.SaveToFile("shared-formula.xlsx") 36 | } 37 | -------------------------------------------------------------------------------- /schema/soo/dml/Tbl_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package dml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/dml" 17 | ) 18 | 19 | func TestTblConstructor(t *testing.T) { 20 | v := dml.NewTbl() 21 | if v == nil { 22 | t.Errorf("dml.NewTbl must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed dml.Tbl should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestTblMarshalUnmarshal(t *testing.T) { 30 | v := dml.NewTbl() 31 | buf, _ := xml.Marshal(v) 32 | v2 := dml.NewTbl() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/pml/Sld_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package pml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/pml" 17 | ) 18 | 19 | func TestSldConstructor(t *testing.T) { 20 | v := pml.NewSld() 21 | if v == nil { 22 | t.Errorf("pml.NewSld must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed pml.Sld should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestSldMarshalUnmarshal(t *testing.T) { 30 | v := pml.NewSld() 31 | buf, _ := xml.Marshal(v) 32 | v2 := pml.NewSld() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/Sst_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestSstConstructor(t *testing.T) { 20 | v := sml.NewSst() 21 | if v == nil { 22 | t.Errorf("sml.NewSst must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.Sst should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestSstMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewSst() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewSst() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/Ftr_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestFtrConstructor(t *testing.T) { 20 | v := wml.NewFtr() 21 | if v == nil { 22 | t.Errorf("wml.NewFtr must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.Ftr should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestFtrMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewFtr() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewFtr() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/Hdr_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestHdrConstructor(t *testing.T) { 20 | v := wml.NewHdr() 21 | if v == nil { 22 | t.Errorf("wml.NewHdr must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.Hdr should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestHdrMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewHdr() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewHdr() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /presentation/slidelayout.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package presentation 9 | 10 | import ( 11 | "github.com/carmel/gooxml/schema/soo/pml" 12 | ) 13 | 14 | // SlideLayout 15 | type SlideLayout struct { 16 | x *pml.SldLayout 17 | } 18 | 19 | // X returns the inner wrapped XML type. 20 | func (s SlideLayout) X() *pml.SldLayout { 21 | return s.x 22 | } 23 | 24 | // Type returns the type of the slide layout. 25 | func (s SlideLayout) Type() pml.ST_SlideLayoutType { 26 | return s.x.TypeAttr 27 | } 28 | 29 | // Name returns the name of the slide layout. 30 | func (s SlideLayout) Name() string { 31 | if s.x.CSld != nil && s.x.CSld.NameAttr != nil { 32 | return *s.x.CSld.NameAttr 33 | } 34 | return "" 35 | } 36 | -------------------------------------------------------------------------------- /schema/soo/dml/Blip_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package dml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/dml" 17 | ) 18 | 19 | func TestBlipConstructor(t *testing.T) { 20 | v := dml.NewBlip() 21 | if v == nil { 22 | t.Errorf("dml.NewBlip must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed dml.Blip should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestBlipMarshalUnmarshal(t *testing.T) { 30 | v := dml.NewBlip() 31 | buf, _ := xml.Marshal(v) 32 | v2 := dml.NewBlip() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_I_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_IConstructor(t *testing.T) { 20 | v := sml.NewCT_I() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_I must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_I should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_IMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_I() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_I() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_X_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_XConstructor(t *testing.T) { 20 | v := sml.NewCT_X() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_X must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_X should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_XMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_X() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_X() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_P_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_PConstructor(t *testing.T) { 20 | v := wml.NewCT_P() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_P must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_P should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_PMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_P() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_P() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_R_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_RConstructor(t *testing.T) { 20 | v := wml.NewCT_R() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_R must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_R should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_RMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_R() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_R() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/schemaLibrary/common.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package schemaLibrary 11 | 12 | import "github.com/carmel/gooxml" 13 | 14 | // init registers constructor functions for dynamically creating elements based off the XML namespace and name 15 | func init() { 16 | gooxml.RegisterConstructor("http://schemas.openxmlformats.org/schemaLibrary/2006/main", "CT_Schema", NewCT_Schema) 17 | gooxml.RegisterConstructor("http://schemas.openxmlformats.org/schemaLibrary/2006/main", "CT_SchemaLibrary", NewCT_SchemaLibrary) 18 | gooxml.RegisterConstructor("http://schemas.openxmlformats.org/schemaLibrary/2006/main", "schemaLibrary", NewSchemaLibrary) 19 | } 20 | -------------------------------------------------------------------------------- /_examples/spreadsheet/rich-text/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | package main 3 | 4 | import ( 5 | "fmt" 6 | "log" 7 | 8 | "github.com/carmel/gooxml/color" 9 | "github.com/carmel/gooxml/spreadsheet" 10 | ) 11 | 12 | func main() { 13 | ss := spreadsheet.New() 14 | // add a single sheet 15 | sheet := ss.AddSheet() 16 | 17 | // rows 18 | for r := 0; r < 5; r++ { 19 | row := sheet.AddRow() 20 | // and cells 21 | for c := 0; c < 5; c++ { 22 | cell := row.AddCell() 23 | //cell.SetString(fmt.Sprintf("row %d cell %d", r, c)) 24 | rt := cell.SetRichTextString() 25 | run := rt.AddRun() 26 | run.SetText(fmt.Sprintf("row %d ", r)) 27 | run.SetBold(true) 28 | run.SetColor(color.Red) 29 | 30 | run = rt.AddRun() 31 | run.SetSize(16) 32 | run.SetItalic(true) 33 | run.SetFont("Courier") 34 | run.SetText(fmt.Sprintf("cell %d", c)) 35 | 36 | } 37 | } 38 | 39 | if err := ss.Validate(); err != nil { 40 | log.Fatalf("error validating sheet: %s", err) 41 | } 42 | 43 | ss.SaveToFile("rich-text.xlsx") 44 | } 45 | -------------------------------------------------------------------------------- /schema/soo/dml/Theme_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package dml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/dml" 17 | ) 18 | 19 | func TestThemeConstructor(t *testing.T) { 20 | v := dml.NewTheme() 21 | if v == nil { 22 | t.Errorf("dml.NewTheme must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed dml.Theme should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestThemeMarshalUnmarshal(t *testing.T) { 30 | v := dml.NewTheme() 31 | buf, _ := xml.Marshal(v) 32 | v2 := dml.NewTheme() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/pml/CmLst_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package pml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/pml" 17 | ) 18 | 19 | func TestCmLstConstructor(t *testing.T) { 20 | v := pml.NewCmLst() 21 | if v == nil { 22 | t.Errorf("pml.NewCmLst must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed pml.CmLst should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCmLstMarshalUnmarshal(t *testing.T) { 30 | v := pml.NewCmLst() 31 | buf, _ := xml.Marshal(v) 32 | v2 := pml.NewCmLst() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/pml/Notes_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package pml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/pml" 17 | ) 18 | 19 | func TestNotesConstructor(t *testing.T) { 20 | v := pml.NewNotes() 21 | if v == nil { 22 | t.Errorf("pml.NewNotes must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed pml.Notes should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestNotesMarshalUnmarshal(t *testing.T) { 30 | v := pml.NewNotes() 31 | buf, _ := xml.Marshal(v) 32 | v2 := pml.NewNotes() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_Xf_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_XfConstructor(t *testing.T) { 20 | v := sml.NewCT_Xf() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_Xf must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_Xf should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_XfMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_Xf() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_Xf() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/Table_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestTableConstructor(t *testing.T) { 20 | v := sml.NewTable() 21 | if v == nil { 22 | t.Errorf("sml.NewTable must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.Table should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestTableMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewTable() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewTable() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/Users_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestUsersConstructor(t *testing.T) { 20 | v := sml.NewUsers() 21 | if v == nil { 22 | t.Errorf("sml.NewUsers must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.Users should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestUsersMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewUsers() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewUsers() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Br_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_BrConstructor(t *testing.T) { 20 | v := wml.NewCT_Br() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Br must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Br should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_BrMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Br() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Br() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Em_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_EmConstructor(t *testing.T) { 20 | v := wml.NewCT_Em() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Em must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Em should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_EmMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Em() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Em() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Jc_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_JcConstructor(t *testing.T) { 20 | v := wml.NewCT_Jc() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Jc must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Jc should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_JcMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Jc() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Jc() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Tc_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_TcConstructor(t *testing.T) { 20 | v := wml.NewCT_Tc() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Tc must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Tc should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_TcMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Tc() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Tc() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/Fonts_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestFontsConstructor(t *testing.T) { 20 | v := wml.NewFonts() 21 | if v == nil { 22 | t.Errorf("wml.NewFonts must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.Fonts should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestFontsMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewFonts() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewFonts() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/WdWgp_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestWdWgpConstructor(t *testing.T) { 20 | v := wml.NewWdWgp() 21 | if v == nil { 22 | t.Errorf("wml.NewWdWgp must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.WdWgp should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestWdWgpMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewWdWgp() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewWdWgp() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/WdWpc_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestWdWpcConstructor(t *testing.T) { 20 | v := wml.NewWdWpc() 21 | if v == nil { 22 | t.Errorf("wml.NewWdWpc must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.WdWpc should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestWdWpcMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewWdWpc() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewWdWpc() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/WdWsp_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestWdWspConstructor(t *testing.T) { 20 | v := wml.NewWdWsp() 21 | if v == nil { 22 | t.Errorf("wml.NewWdWsp must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.WdWsp should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestWdWspMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewWdWsp() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewWdWsp() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/ofc/math/CT_D_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package math_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/ofc/math" 17 | ) 18 | 19 | func TestCT_DConstructor(t *testing.T) { 20 | v := math.NewCT_D() 21 | if v == nil { 22 | t.Errorf("math.NewCT_D must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed math.CT_D should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_DMarshalUnmarshal(t *testing.T) { 30 | v := math.NewCT_D() 31 | buf, _ := xml.Marshal(v) 32 | v2 := math.NewCT_D() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/ofc/math/CT_F_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package math_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/ofc/math" 17 | ) 18 | 19 | func TestCT_FConstructor(t *testing.T) { 20 | v := math.NewCT_F() 21 | if v == nil { 22 | t.Errorf("math.NewCT_F must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed math.CT_F should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_FMarshalUnmarshal(t *testing.T) { 30 | v := math.NewCT_F() 31 | buf, _ := xml.Marshal(v) 32 | v2 := math.NewCT_F() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/ofc/math/CT_M_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package math_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/ofc/math" 17 | ) 18 | 19 | func TestCT_MConstructor(t *testing.T) { 20 | v := math.NewCT_M() 21 | if v == nil { 22 | t.Errorf("math.NewCT_M must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed math.CT_M should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_MMarshalUnmarshal(t *testing.T) { 30 | v := math.NewCT_M() 31 | buf, _ := xml.Marshal(v) 32 | v2 := math.NewCT_M() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/ofc/math/CT_R_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package math_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/ofc/math" 17 | ) 18 | 19 | func TestCT_RConstructor(t *testing.T) { 20 | v := math.NewCT_R() 21 | if v == nil { 22 | t.Errorf("math.NewCT_R must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed math.CT_R should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_RMarshalUnmarshal(t *testing.T) { 30 | v := math.NewCT_R() 31 | buf, _ := xml.Marshal(v) 32 | v2 := math.NewCT_R() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/pml/AG_Ole_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package pml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/pml" 17 | ) 18 | 19 | func TestAG_OleConstructor(t *testing.T) { 20 | v := pml.NewAG_Ole() 21 | if v == nil { 22 | t.Errorf("pml.NewAG_Ole must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed pml.AG_Ole should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestAG_OleMarshalUnmarshal(t *testing.T) { 30 | v := pml.NewAG_Ole() 31 | buf, _ := xml.Marshal(v) 32 | v2 := pml.NewAG_Ole() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/pml/CT_Rel_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package pml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/pml" 17 | ) 18 | 19 | func TestCT_RelConstructor(t *testing.T) { 20 | v := pml.NewCT_Rel() 21 | if v == nil { 22 | t.Errorf("pml.NewCT_Rel must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed pml.CT_Rel should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_RelMarshalUnmarshal(t *testing.T) { 30 | v := pml.NewCT_Rel() 31 | buf, _ := xml.Marshal(v) 32 | v2 := pml.NewCT_Rel() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/pml/OleObj_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package pml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/pml" 17 | ) 18 | 19 | func TestOleObjConstructor(t *testing.T) { 20 | v := pml.NewOleObj() 21 | if v == nil { 22 | t.Errorf("pml.NewOleObj must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed pml.OleObj should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestOleObjMarshalUnmarshal(t *testing.T) { 30 | v := pml.NewOleObj() 31 | buf, _ := xml.Marshal(v) 32 | v2 := pml.NewOleObj() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/pml/TagLst_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package pml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/pml" 17 | ) 18 | 19 | func TestTagLstConstructor(t *testing.T) { 20 | v := pml.NewTagLst() 21 | if v == nil { 22 | t.Errorf("pml.NewTagLst must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed pml.TagLst should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestTagLstMarshalUnmarshal(t *testing.T) { 30 | v := pml.NewTagLst() 31 | buf, _ := xml.Marshal(v) 32 | v2 := pml.NewTagLst() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/pml/ViewPr_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package pml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/pml" 17 | ) 18 | 19 | func TestViewPrConstructor(t *testing.T) { 20 | v := pml.NewViewPr() 21 | if v == nil { 22 | t.Errorf("pml.NewViewPr must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed pml.ViewPr should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestViewPrMarshalUnmarshal(t *testing.T) { 30 | v := pml.NewViewPr() 31 | buf, _ := xml.Marshal(v) 32 | v2 := pml.NewViewPr() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_Col_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_ColConstructor(t *testing.T) { 20 | v := sml.NewCT_Col() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_Col must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_Col should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_ColMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_Col() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_Col() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_Dxf_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_DxfConstructor(t *testing.T) { 20 | v := sml.NewCT_Dxf() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_Dxf must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_Dxf should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_DxfMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_Dxf() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_Dxf() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_Map_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_MapConstructor(t *testing.T) { 20 | v := sml.NewCT_Map() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_Map must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_Map should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_MapMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_Map() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_Map() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_Mdx_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_MdxConstructor(t *testing.T) { 20 | v := sml.NewCT_Mdx() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_Mdx must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_Mdx should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_MdxMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_Mdx() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_Mdx() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_Row_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_RowConstructor(t *testing.T) { 20 | v := sml.NewCT_Row() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_Row must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_Row should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_RowMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_Row() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_Row() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_Rst_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_RstConstructor(t *testing.T) { 20 | v := sml.NewCT_Rst() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_Rst must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_Rst should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_RstMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_Rst() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_Rst() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_Set_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_SetConstructor(t *testing.T) { 20 | v := sml.NewCT_Set() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_Set must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_Set should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_SetMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_Set() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_Set() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_Sst_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_SstConstructor(t *testing.T) { 20 | v := sml.NewCT_Sst() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_Sst must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_Sst should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_SstMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_Sst() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_Sst() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Cnf_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_CnfConstructor(t *testing.T) { 20 | v := wml.NewCT_Cnf() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Cnf must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Cnf should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_CnfMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Cnf() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Cnf() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Div_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_DivConstructor(t *testing.T) { 20 | v := wml.NewCT_Div() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Div must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Div should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_DivMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Div() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Div() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Ind_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_IndConstructor(t *testing.T) { 20 | v := wml.NewCT_Ind() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Ind must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Ind should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_IndMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Ind() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Ind() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Lvl_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_LvlConstructor(t *testing.T) { 20 | v := wml.NewCT_Lvl() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Lvl must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Lvl should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_LvlMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Lvl() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Lvl() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Num_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_NumConstructor(t *testing.T) { 20 | v := wml.NewCT_Num() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Num must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Num should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_NumMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Num() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Num() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_PPr_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_PPrConstructor(t *testing.T) { 20 | v := wml.NewCT_PPr() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_PPr must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_PPr should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_PPrMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_PPr() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_PPr() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_RPr_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_RPrConstructor(t *testing.T) { 20 | v := wml.NewCT_RPr() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_RPr must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_RPr should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_RPrMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_RPr() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_RPr() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Rel_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_RelConstructor(t *testing.T) { 20 | v := wml.NewCT_Rel() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Rel must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Rel should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_RelMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Rel() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Rel() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Row_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_RowConstructor(t *testing.T) { 20 | v := wml.NewCT_Row() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Row must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Row should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_RowMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Row() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Row() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Shd_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_ShdConstructor(t *testing.T) { 20 | v := wml.NewCT_Shd() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Shd must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Shd should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_ShdMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Shd() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Shd() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Sym_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_SymConstructor(t *testing.T) { 20 | v := wml.NewCT_Sym() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Sym must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Sym should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_SymMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Sym() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Sym() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Tbl_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_TblConstructor(t *testing.T) { 20 | v := wml.NewCT_Tbl() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Tbl must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Tbl should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_TblMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Tbl() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Tbl() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/EG_RPr_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestEG_RPrConstructor(t *testing.T) { 20 | v := wml.NewEG_RPr() 21 | if v == nil { 22 | t.Errorf("wml.NewEG_RPr must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.EG_RPr should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestEG_RPrMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewEG_RPr() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewEG_RPr() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/Styles_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestStylesConstructor(t *testing.T) { 20 | v := wml.NewStyles() 21 | if v == nil { 22 | t.Errorf("wml.NewStyles must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.Styles should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestStylesMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewStyles() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewStyles() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/purl.org/dc/elements/common.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package elements 11 | 12 | import "github.com/carmel/gooxml" 13 | 14 | // init registers constructor functions for dynamically creating elements based off the XML namespace and name 15 | func init() { 16 | gooxml.RegisterConstructor("http://purl.org/dc/elements/1.1/", "SimpleLiteral", NewSimpleLiteral) 17 | gooxml.RegisterConstructor("http://purl.org/dc/elements/1.1/", "elementContainer", NewElementContainer) 18 | gooxml.RegisterConstructor("http://purl.org/dc/elements/1.1/", "any", NewAny) 19 | gooxml.RegisterConstructor("http://purl.org/dc/elements/1.1/", "elementsGroup", NewElementsGroup) 20 | } 21 | -------------------------------------------------------------------------------- /schema/purl.org/dc/terms/Box_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package terms_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/purl.org/dc/terms" 17 | ) 18 | 19 | func TestBoxConstructor(t *testing.T) { 20 | v := terms.NewBox() 21 | if v == nil { 22 | t.Errorf("terms.NewBox must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed terms.Box should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestBoxMarshalUnmarshal(t *testing.T) { 30 | v := terms.NewBox() 31 | buf, _ := xml.Marshal(v) 32 | v2 := terms.NewBox() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/purl.org/dc/terms/DDC_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package terms_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/purl.org/dc/terms" 17 | ) 18 | 19 | func TestDDCConstructor(t *testing.T) { 20 | v := terms.NewDDC() 21 | if v == nil { 22 | t.Errorf("terms.NewDDC must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed terms.DDC should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestDDCMarshalUnmarshal(t *testing.T) { 30 | v := terms.NewDDC() 31 | buf, _ := xml.Marshal(v) 32 | v2 := terms.NewDDC() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/purl.org/dc/terms/IMT_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package terms_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/purl.org/dc/terms" 17 | ) 18 | 19 | func TestIMTConstructor(t *testing.T) { 20 | v := terms.NewIMT() 21 | if v == nil { 22 | t.Errorf("terms.NewIMT must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed terms.IMT should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestIMTMarshalUnmarshal(t *testing.T) { 30 | v := terms.NewIMT() 31 | buf, _ := xml.Marshal(v) 32 | v2 := terms.NewIMT() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/purl.org/dc/terms/LCC_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package terms_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/purl.org/dc/terms" 17 | ) 18 | 19 | func TestLCCConstructor(t *testing.T) { 20 | v := terms.NewLCC() 21 | if v == nil { 22 | t.Errorf("terms.NewLCC must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed terms.LCC should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestLCCMarshalUnmarshal(t *testing.T) { 30 | v := terms.NewLCC() 31 | buf, _ := xml.Marshal(v) 32 | v2 := terms.NewLCC() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/purl.org/dc/terms/TGN_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package terms_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/purl.org/dc/terms" 17 | ) 18 | 19 | func TestTGNConstructor(t *testing.T) { 20 | v := terms.NewTGN() 21 | if v == nil { 22 | t.Errorf("terms.NewTGN must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed terms.TGN should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestTGNMarshalUnmarshal(t *testing.T) { 30 | v := terms.NewTGN() 31 | buf, _ := xml.Marshal(v) 32 | v2 := terms.NewTGN() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/purl.org/dc/terms/UDC_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package terms_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/purl.org/dc/terms" 17 | ) 18 | 19 | func TestUDCConstructor(t *testing.T) { 20 | v := terms.NewUDC() 21 | if v == nil { 22 | t.Errorf("terms.NewUDC must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed terms.UDC should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestUDCMarshalUnmarshal(t *testing.T) { 30 | v := terms.NewUDC() 31 | buf, _ := xml.Marshal(v) 32 | v2 := terms.NewUDC() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/purl.org/dc/terms/URI_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package terms_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/purl.org/dc/terms" 17 | ) 18 | 19 | func TestURIConstructor(t *testing.T) { 20 | v := terms.NewURI() 21 | if v == nil { 22 | t.Errorf("terms.NewURI must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed terms.URI should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestURIMarshalUnmarshal(t *testing.T) { 30 | v := terms.NewURI() 31 | buf, _ := xml.Marshal(v) 32 | v2 := terms.NewURI() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/dml/AG_Blob_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package dml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/dml" 17 | ) 18 | 19 | func TestAG_BlobConstructor(t *testing.T) { 20 | v := dml.NewAG_Blob() 21 | if v == nil { 22 | t.Errorf("dml.NewAG_Blob must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed dml.AG_Blob should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestAG_BlobMarshalUnmarshal(t *testing.T) { 30 | v := dml.NewAG_Blob() 31 | buf, _ := xml.Marshal(v) 32 | v2 := dml.NewAG_Blob() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/dml/CT_Blip_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package dml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/dml" 17 | ) 18 | 19 | func TestCT_BlipConstructor(t *testing.T) { 20 | v := dml.NewCT_Blip() 21 | if v == nil { 22 | t.Errorf("dml.NewCT_Blip must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed dml.CT_Blip should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_BlipMarshalUnmarshal(t *testing.T) { 30 | v := dml.NewCT_Blip() 31 | buf, _ := xml.Marshal(v) 32 | v2 := dml.NewCT_Blip() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/dml/Graphic_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package dml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/dml" 17 | ) 18 | 19 | func TestGraphicConstructor(t *testing.T) { 20 | v := dml.NewGraphic() 21 | if v == nil { 22 | t.Errorf("dml.NewGraphic must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed dml.Graphic should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestGraphicMarshalUnmarshal(t *testing.T) { 30 | v := dml.NewGraphic() 31 | buf, _ := xml.Marshal(v) 32 | v2 := dml.NewGraphic() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/ofc/math/CT_MC_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package math_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/ofc/math" 17 | ) 18 | 19 | func TestCT_MCConstructor(t *testing.T) { 20 | v := math.NewCT_MC() 21 | if v == nil { 22 | t.Errorf("math.NewCT_MC must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed math.CT_MC should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_MCMarshalUnmarshal(t *testing.T) { 30 | v := math.NewCT_MC() 31 | buf, _ := xml.Marshal(v) 32 | v2 := math.NewCT_MC() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/ofc/math/CT_MR_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package math_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/ofc/math" 17 | ) 18 | 19 | func TestCT_MRConstructor(t *testing.T) { 20 | v := math.NewCT_MR() 21 | if v == nil { 22 | t.Errorf("math.NewCT_MR must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed math.CT_MR should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_MRMarshalUnmarshal(t *testing.T) { 30 | v := math.NewCT_MR() 31 | buf, _ := xml.Marshal(v) 32 | v2 := math.NewCT_MR() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/ofc/math/OMath_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package math_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/ofc/math" 17 | ) 18 | 19 | func TestOMathConstructor(t *testing.T) { 20 | v := math.NewOMath() 21 | if v == nil { 22 | t.Errorf("math.NewOMath must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed math.OMath should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestOMathMarshalUnmarshal(t *testing.T) { 30 | v := math.NewOMath() 31 | buf, _ := xml.Marshal(v) 32 | v2 := math.NewOMath() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_Cell_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_CellConstructor(t *testing.T) { 20 | v := sml.NewCT_Cell() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_Cell must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_Cell should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_CellMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_Cell() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_Cell() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_Cfvo_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_CfvoConstructor(t *testing.T) { 20 | v := sml.NewCT_Cfvo() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_Cfvo must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_Cfvo should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_CfvoMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_Cfvo() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_Cfvo() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_Cols_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_ColsConstructor(t *testing.T) { 20 | v := sml.NewCT_Cols() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_Cols must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_Cols should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_ColsMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_Cols() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_Cols() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_DbPr_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_DbPrConstructor(t *testing.T) { 20 | v := sml.NewCT_DbPr() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_DbPr must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_DbPr should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_DbPrMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_DbPr() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_DbPr() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_Dxfs_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_DxfsConstructor(t *testing.T) { 20 | v := sml.NewCT_Dxfs() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_Dxfs must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_Dxfs should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_DxfsMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_Dxfs() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_Dxfs() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_Fill_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_FillConstructor(t *testing.T) { 20 | v := sml.NewCT_Fill() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_Fill must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_Fill should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_FillMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_Fill() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_Fill() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_Font_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_FontConstructor(t *testing.T) { 20 | v := sml.NewCT_Font() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_Font must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_Font should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_FontMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_Font() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_Font() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_Item_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_ItemConstructor(t *testing.T) { 20 | v := sml.NewCT_Item() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_Item must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_Item should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_ItemMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_Item() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_Item() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_Pane_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_PaneConstructor(t *testing.T) { 20 | v := sml.NewCT_Pane() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_Pane must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_Pane should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_PaneMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_Pane() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_Pane() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_RElt_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_REltConstructor(t *testing.T) { 20 | v := sml.NewCT_RElt() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_RElt must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_RElt should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_REltMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_RElt() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_RElt() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/CT_Sets_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestCT_SetsConstructor(t *testing.T) { 20 | v := sml.NewCT_Sets() 21 | if v == nil { 22 | t.Errorf("sml.NewCT_Sets must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.CT_Sets should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_SetsMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewCT_Sets() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewCT_Sets() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/Headers_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestHeadersConstructor(t *testing.T) { 20 | v := sml.NewHeaders() 21 | if v == nil { 22 | t.Errorf("sml.NewHeaders must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.Headers should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestHeadersMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewHeaders() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewHeaders() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/sml/MapInfo_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package sml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/sml" 17 | ) 18 | 19 | func TestMapInfoConstructor(t *testing.T) { 20 | v := sml.NewMapInfo() 21 | if v == nil { 22 | t.Errorf("sml.NewMapInfo must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed sml.MapInfo should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestMapInfoMarshalUnmarshal(t *testing.T) { 30 | v := sml.NewMapInfo() 31 | buf, _ := xml.Marshal(v) 32 | v2 := sml.NewMapInfo() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Attr_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_AttrConstructor(t *testing.T) { 20 | v := wml.NewCT_Attr() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Attr must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Attr should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_AttrMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Attr() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Attr() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Body_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_BodyConstructor(t *testing.T) { 20 | v := wml.NewCT_Body() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Body must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Body should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_BodyMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Body() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Body() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Divs_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_DivsConstructor(t *testing.T) { 20 | v := wml.NewCT_Divs() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Divs must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Divs should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_DivsMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Divs() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Divs() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Font_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_FontConstructor(t *testing.T) { 20 | v := wml.NewCT_Font() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Font must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Font should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_FontMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Font() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Font() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Guid_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_GuidConstructor(t *testing.T) { 20 | v := wml.NewCT_Guid() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Guid must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Guid should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_GuidMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Guid() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Guid() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Lang_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_LangConstructor(t *testing.T) { 20 | v := wml.NewCT_Lang() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Lang must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Lang should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_LangMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Lang() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Lang() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Lock_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_LockConstructor(t *testing.T) { 20 | v := wml.NewCT_Lock() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Lock must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Lock should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_LockMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Lock() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Lock() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Odso_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_OdsoConstructor(t *testing.T) { 20 | v := wml.NewCT_Odso() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Odso must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Odso should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_OdsoMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Odso() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Odso() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_PBdr_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_PBdrConstructor(t *testing.T) { 20 | v := wml.NewCT_PBdr() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_PBdr must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_PBdr should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_PBdrMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_PBdr() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_PBdr() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_PTab_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_PTabConstructor(t *testing.T) { 20 | v := wml.NewCT_PTab() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_PTab must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_PTab should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_PTabMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_PTab() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_PTab() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Perm_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_PermConstructor(t *testing.T) { 20 | v := wml.NewCT_Perm() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Perm must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Perm should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_PermMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Perm() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Perm() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Ruby_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_RubyConstructor(t *testing.T) { 20 | v := wml.NewCT_Ruby() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Ruby must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Ruby should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_RubyMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Ruby() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Ruby() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Tabs_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_TabsConstructor(t *testing.T) { 20 | v := wml.NewCT_Tabs() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Tabs must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Tabs should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_TabsMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Tabs() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Tabs() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_TcPr_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_TcPrConstructor(t *testing.T) { 20 | v := wml.NewCT_TcPr() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_TcPr must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_TcPr should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_TcPrMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_TcPr() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_TcPr() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Text_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_TextConstructor(t *testing.T) { 20 | v := wml.NewCT_Text() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Text must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Text should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_TextMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Text() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Text() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_TrPr_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_TrPrConstructor(t *testing.T) { 20 | v := wml.NewCT_TrPr() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_TrPr must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_TrPr should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_TrPrMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_TrPr() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_TrPr() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_View_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_ViewConstructor(t *testing.T) { 20 | v := wml.NewCT_View() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_View must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_View should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_ViewMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_View() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_View() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/wml/CT_Zoom_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package wml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/wml" 17 | ) 18 | 19 | func TestCT_ZoomConstructor(t *testing.T) { 20 | v := wml.NewCT_Zoom() 21 | if v == nil { 22 | t.Errorf("wml.NewCT_Zoom must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed wml.CT_Zoom should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_ZoomMarshalUnmarshal(t *testing.T) { 30 | v := wml.NewCT_Zoom() 31 | buf, _ := xml.Marshal(v) 32 | v2 := wml.NewCT_Zoom() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /spreadsheet/format/isnumber_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package format_test 9 | 10 | import ( 11 | "testing" 12 | 13 | "github.com/carmel/gooxml/spreadsheet/format" 14 | ) 15 | 16 | func TestIsNumber(t *testing.T) { 17 | td := []struct { 18 | Inp string 19 | Exp bool 20 | }{ 21 | {"123", true}, 22 | {"1.23", true}, 23 | {"1.23.", false}, 24 | {"1.23E+10", true}, 25 | {"1.23E-10", true}, 26 | {"1.23E10", false}, 27 | {"1213131312312312390", true}, 28 | {"0", true}, 29 | {"", false}, 30 | {"abc", false}, 31 | } 32 | for _, tc := range td { 33 | got := format.IsNumber(tc.Inp) 34 | if got != tc.Exp { 35 | t.Errorf("expected IsNumber(%s) = %v, got %v", tc.Inp, tc.Exp, got) 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /spreadsheet/formula/invalidreferencecontext.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package formula 9 | 10 | // InvalidReferenceContext is a Context that can be used when evaluating an 11 | // invalid reference (e.g. referencing a non-existent sheet). It implements 12 | // Context safely, but returns error results. 13 | var InvalidReferenceContext = &ivr{} 14 | 15 | type ivr struct { 16 | } 17 | 18 | func (i *ivr) Cell(ref string, ev Evaluator) Result { 19 | return MakeErrorResult("invalid reference") 20 | } 21 | 22 | func (i *ivr) NamedRange(ref string) Reference { 23 | return ReferenceInvalid 24 | } 25 | 26 | func (i *ivr) Sheet(name string) Context { 27 | return i 28 | } 29 | 30 | func (i *ivr) SetOffset(col, row uint32) { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /document/onoffvalue.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package document 9 | 10 | import "github.com/carmel/gooxml/schema/soo/wml" 11 | 12 | // OnOffValue represents an on/off value that can also be unset 13 | type OnOffValue byte 14 | 15 | // OnOffValue constants 16 | const ( 17 | OnOffValueUnset OnOffValue = iota 18 | OnOffValueOff 19 | OnOffValueOn 20 | ) 21 | 22 | func convertOnOff(v *wml.CT_OnOff) OnOffValue { 23 | if v == nil { 24 | return OnOffValueUnset 25 | } 26 | // set, but the value is set to false 27 | if v.ValAttr != nil && v.ValAttr.Bool != nil && *v.ValAttr.Bool == false { 28 | return OnOffValueOff 29 | } 30 | // element exists, which implies turned on (and boolean value can't be false) 31 | return OnOffValueOn 32 | } 33 | -------------------------------------------------------------------------------- /presentation/open.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package presentation 9 | 10 | import ( 11 | "fmt" 12 | "os" 13 | ) 14 | 15 | func OpenTemplate(fn string) (*Presentation, error) { 16 | p, err := Open(fn) 17 | if err != nil { 18 | return nil, err 19 | } 20 | return p, nil 21 | } 22 | 23 | // Open opens and reads a document from a file (.pptx). 24 | func Open(filename string) (*Presentation, error) { 25 | f, err := os.Open(filename) 26 | if err != nil { 27 | return nil, fmt.Errorf("error opening %s: %s", filename, err) 28 | } 29 | defer f.Close() 30 | fi, err := os.Stat(filename) 31 | if err != nil { 32 | return nil, fmt.Errorf("error opening %s: %s", filename, err) 33 | } 34 | _ = fi 35 | return Read(f, fi.Size()) 36 | } 37 | -------------------------------------------------------------------------------- /spreadsheet/formula/evaluator.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // Use of this source code is governed by the terms of the Affero GNU General 4 | // Public License version 3.0 as published by the Free Software Foundation and 5 | // appearing in the file LICENSE included in the packaging of this file. A 6 | // commercial license can be purchased by contacting sales@baliance.com. 7 | 8 | package formula 9 | 10 | import "fmt" 11 | 12 | // Evaluator is the interface for a formula evaluator. This is needed so we can 13 | // pass it to the spreadsheet to let it evaluate formula cells before returning 14 | // the results. 15 | type Evaluator interface { 16 | Eval(ctx Context, formula string) Result 17 | } 18 | 19 | func NewEvaluator() Evaluator { 20 | return &defEval{} 21 | } 22 | 23 | type defEval struct { 24 | } 25 | 26 | func (d *defEval) Eval(ctx Context, formula string) Result { 27 | expr := ParseString(formula) 28 | if expr != nil { 29 | return expr.Eval(ctx, d) 30 | } 31 | return MakeErrorResult(fmt.Sprintf("unable to parse formula %s", formula)) 32 | } 33 | -------------------------------------------------------------------------------- /schema/purl.org/dc/terms/LCSH_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package terms_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/purl.org/dc/terms" 17 | ) 18 | 19 | func TestLCSHConstructor(t *testing.T) { 20 | v := terms.NewLCSH() 21 | if v == nil { 22 | t.Errorf("terms.NewLCSH must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed terms.LCSH should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestLCSHMarshalUnmarshal(t *testing.T) { 30 | v := terms.NewLCSH() 31 | buf, _ := xml.Marshal(v) 32 | v2 := terms.NewLCSH() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/purl.org/dc/terms/MESH_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package terms_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/purl.org/dc/terms" 17 | ) 18 | 19 | func TestMESHConstructor(t *testing.T) { 20 | v := terms.NewMESH() 21 | if v == nil { 22 | t.Errorf("terms.NewMESH must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed terms.MESH should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestMESHMarshalUnmarshal(t *testing.T) { 30 | v := terms.NewMESH() 31 | buf, _ := xml.Marshal(v) 32 | v2 := terms.NewMESH() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/dml/CT_Angle_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package dml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/dml" 17 | ) 18 | 19 | func TestCT_AngleConstructor(t *testing.T) { 20 | v := dml.NewCT_Angle() 21 | if v == nil { 22 | t.Errorf("dml.NewCT_Angle must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed dml.CT_Angle should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_AngleMarshalUnmarshal(t *testing.T) { 30 | v := dml.NewCT_Angle() 31 | buf, _ := xml.Marshal(v) 32 | v2 := dml.NewCT_Angle() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/dml/CT_Bevel_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package dml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/dml" 17 | ) 18 | 19 | func TestCT_BevelConstructor(t *testing.T) { 20 | v := dml.NewCT_Bevel() 21 | if v == nil { 22 | t.Errorf("dml.NewCT_Bevel must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed dml.CT_Bevel should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_BevelMarshalUnmarshal(t *testing.T) { 30 | v := dml.NewCT_Bevel() 31 | buf, _ := xml.Marshal(v) 32 | v2 := dml.NewCT_Bevel() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/dml/CT_Color_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package dml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/dml" 17 | ) 18 | 19 | func TestCT_ColorConstructor(t *testing.T) { 20 | v := dml.NewCT_Color() 21 | if v == nil { 22 | t.Errorf("dml.NewCT_Color must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed dml.CT_Color should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_ColorMarshalUnmarshal(t *testing.T) { 30 | v := dml.NewCT_Color() 31 | buf, _ := xml.Marshal(v) 32 | v2 := dml.NewCT_Color() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/dml/CT_Ratio_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package dml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/dml" 17 | ) 18 | 19 | func TestCT_RatioConstructor(t *testing.T) { 20 | v := dml.NewCT_Ratio() 21 | if v == nil { 22 | t.Errorf("dml.NewCT_Ratio must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed dml.CT_Ratio should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_RatioMarshalUnmarshal(t *testing.T) { 30 | v := dml.NewCT_Ratio() 31 | buf, _ := xml.Marshal(v) 32 | v2 := dml.NewCT_Ratio() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/dml/CT_Table_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package dml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/dml" 17 | ) 18 | 19 | func TestCT_TableConstructor(t *testing.T) { 20 | v := dml.NewCT_Table() 21 | if v == nil { 22 | t.Errorf("dml.NewCT_Table must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed dml.CT_Table should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_TableMarshalUnmarshal(t *testing.T) { 30 | v := dml.NewCT_Table() 31 | buf, _ := xml.Marshal(v) 32 | v2 := dml.NewCT_Table() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/dml/EG_Media_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package dml_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/dml" 17 | ) 18 | 19 | func TestEG_MediaConstructor(t *testing.T) { 20 | v := dml.NewEG_Media() 21 | if v == nil { 22 | t.Errorf("dml.NewEG_Media must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed dml.EG_Media should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestEG_MediaMarshalUnmarshal(t *testing.T) { 30 | v := dml.NewEG_Media() 31 | buf, _ := xml.Marshal(v) 32 | v2 := dml.NewEG_Media() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/dml/chart/CT_Tx_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package chart_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/dml/chart" 17 | ) 18 | 19 | func TestCT_TxConstructor(t *testing.T) { 20 | v := chart.NewCT_Tx() 21 | if v == nil { 22 | t.Errorf("chart.NewCT_Tx must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed chart.CT_Tx should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestCT_TxMarshalUnmarshal(t *testing.T) { 30 | v := chart.NewCT_Tx() 31 | buf, _ := xml.Marshal(v) 32 | v2 := chart.NewCT_Tx() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | -------------------------------------------------------------------------------- /schema/soo/dml/chart/Chart_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Baliance. All rights reserved. 2 | // 3 | // DO NOT EDIT: generated by gooxml ECMA-376 generator 4 | // 5 | // Use of this source code is governed by the terms of the Affero GNU General 6 | // Public License version 3.0 as published by the Free Software Foundation and 7 | // appearing in the file LICENSE included in the packaging of this file. A 8 | // commercial license can be purchased by contacting sales@baliance.com. 9 | 10 | package chart_test 11 | 12 | import ( 13 | "encoding/xml" 14 | "testing" 15 | 16 | "github.com/carmel/gooxml/schema/soo/dml/chart" 17 | ) 18 | 19 | func TestChartConstructor(t *testing.T) { 20 | v := chart.NewChart() 21 | if v == nil { 22 | t.Errorf("chart.NewChart must return a non-nil value") 23 | } 24 | if err := v.Validate(); err != nil { 25 | t.Errorf("newly constructed chart.Chart should validate: %s", err) 26 | } 27 | } 28 | 29 | func TestChartMarshalUnmarshal(t *testing.T) { 30 | v := chart.NewChart() 31 | buf, _ := xml.Marshal(v) 32 | v2 := chart.NewChart() 33 | xml.Unmarshal(buf, v2) 34 | } 35 | --------------------------------------------------------------------------------