2020-06-30 22:50:09 +07:00
|
|
|
// Copyright 2020 FoxyUtils ehf. All rights reserved.
|
2017-08-28 20:56:18 -05:00
|
|
|
//
|
2020-06-30 22:50:09 +07:00
|
|
|
// DO NOT EDIT: generated by unioffice ECMA-376 generator
|
2017-09-09 10:21:47 -05:00
|
|
|
//
|
2020-08-08 01:01:05 +00:00
|
|
|
// Use of this software package and source code is governed by the terms of the
|
|
|
|
// UniDoc End User License Agreement (EULA) that is available at:
|
|
|
|
// https://unidoc.io/eula/
|
|
|
|
// A trial license code for evaluation can be obtained at https://unidoc.io website.
|
2017-08-28 20:56:18 -05:00
|
|
|
|
|
|
|
package chart
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/xml"
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Chart struct {
|
|
|
|
CT_RelId
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewChart() *Chart {
|
|
|
|
ret := &Chart{}
|
|
|
|
ret.CT_RelId = *NewCT_RelId()
|
|
|
|
return ret
|
|
|
|
}
|
2017-09-01 15:19:23 -05:00
|
|
|
|
2017-08-28 20:56:18 -05:00
|
|
|
func (m *Chart) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
|
|
|
|
start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/chart"})
|
2018-01-31 13:45:35 -06:00
|
|
|
start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"})
|
2017-08-28 20:56:18 -05:00
|
|
|
start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:c"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/chart"})
|
|
|
|
start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"})
|
2017-09-10 10:02:39 -05:00
|
|
|
start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:s"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"})
|
2017-08-28 20:56:18 -05:00
|
|
|
start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"})
|
2017-09-03 09:29:13 -05:00
|
|
|
start.Name.Local = "c:chart"
|
2017-08-28 20:56:18 -05:00
|
|
|
return m.CT_RelId.MarshalXML(e, start)
|
|
|
|
}
|
2017-09-01 15:19:23 -05:00
|
|
|
|
2017-08-28 20:56:18 -05:00
|
|
|
func (m *Chart) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
|
|
|
|
// initialize to default
|
|
|
|
m.CT_RelId = *NewCT_RelId()
|
|
|
|
for _, attr := range start.Attr {
|
2019-04-29 18:32:26 +03:00
|
|
|
if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "id" ||
|
|
|
|
attr.Name.Space == "http://purl.oclc.org/ooxml/officeDocument/relationships" && attr.Name.Local == "id" {
|
2017-08-28 20:56:18 -05:00
|
|
|
parsed, err := attr.Value, error(nil)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
m.IdAttr = parsed
|
2017-10-05 09:15:10 -04:00
|
|
|
continue
|
2017-08-28 20:56:18 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// skip any extensions we may find, but don't support
|
|
|
|
for {
|
|
|
|
tok, err := d.Token()
|
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("parsing Chart: %s", err)
|
|
|
|
}
|
|
|
|
if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
2017-09-01 15:19:23 -05:00
|
|
|
|
|
|
|
// Validate validates the Chart and its children
|
2017-08-28 20:56:18 -05:00
|
|
|
func (m *Chart) Validate() error {
|
|
|
|
return m.ValidateWithPath("Chart")
|
|
|
|
}
|
2017-09-01 15:19:23 -05:00
|
|
|
|
|
|
|
// ValidateWithPath validates the Chart and its children, prefixing error messages with path
|
2017-08-28 20:56:18 -05:00
|
|
|
func (m *Chart) ValidateWithPath(path string) error {
|
|
|
|
if err := m.CT_RelId.ValidateWithPath(path); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|