Documentation ¶
Overview ¶
This package implements rudimentary support for reading Open Document Spreadsheet files. At current stage table data can be accessed.
Index ¶
Constants ¶
const (
ISO8601 = "2006-01-02T15:04:05"
)
const (
MimeTypePfx = "application/vnd.oasis.opendocument."
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DocStats ¶
type DocStats struct { Tables int `xml:"table-count,attr"` Cells int `xml:"cell-count,attr"` Images int `xml:"image-count,attr"` Objects int `xml:"object-count,attr"` Pages int `xml:"page-count,attr"` Paragraphs int `xml:"paragraph-count,attr"` Words int `xml:"word-count,attr"` Characters int `xml:"character-count,attr"` }
type DocumentMeta ¶
type Meta ¶
type Meta struct { Title string `xml:"title"` InitialCreator Time `xml:"initial-creator"` CreationDate Time `xml:"creation-date"` DcCreator string `xml:"dc creator"` DcDate string `xml:"dc date"` DcLang string `xml:"dc language"` EditingCycles int `xml:"editing-cycles"` EditingDuration string `xml:"editing-duration"` Stats DocStats `xml:"document-statistic"` Generator string `xml:"generator"` UserDefined []struct { Name string `xml:"name,attr"` Text string `xml:",chardata"` } `xml:"user-defined"` }
type ODFFile ¶
func NewODFReader ¶
NewReader initializes a File struct with an already opened ODF file, and checks the file's MIME type. The returned *ODFFile provides access to files embedded in the ODF file, like content.xml.
func OpenODF ¶
Open an OpenDocument file for reading, and check its MIME type. The returned *ODFFile provides -- via its Open method -- access to files embedded in the ODF, like content.xml.
func (*ODFFile) Meta ¶
func (f *ODFFile) Meta() (docMeta *DocumentMeta, err error)
type ODSCell ¶
type ODSFile ¶
type ODSFile struct {
*ODFFile
}
func NewODSReader ¶
NewReader initializes a File struct with an already opened ODS file, and checks the spreadsheet's media type.
func OpenODS ¶
Open an ODS file. If the file doesn't exist or doesn't look like a spreadsheet file, an error is returned.
func (*ODSFile) ParseContent ¶
Parse the content.xml part of an ODS file. On Success the returned Doc will contain the data of the rows and cells of the table(s) contained in the ODS file.