2017-09-10 11:25:29 -05:00

95 lines
2.2 KiB
Go

// Copyright 2017 Baliance. All rights reserved.
//
// DO NOT EDIT: generated by gooxml ECMA-376 generator
//
// Use of this source code is governed by the terms of the Affero GNU General
// Public License version 3.0 as published by the Free Software Foundation and
// appearing in the file LICENSE included in the packaging of this file. A
// commercial license can be purchased by contacting sales@baliance.com.
package vml
import (
"encoding/xml"
"fmt"
)
type OfcSkew struct {
OfcCT_Skew
}
func NewOfcSkew() *OfcSkew {
ret := &OfcSkew{}
ret.OfcCT_Skew = *NewOfcCT_Skew()
return ret
}
func (m *OfcSkew) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
return m.OfcCT_Skew.MarshalXML(e, start)
}
func (m *OfcSkew) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
// initialize to default
m.OfcCT_Skew = *NewOfcCT_Skew()
for _, attr := range start.Attr {
if attr.Name.Local == "id" {
parsed, err := attr.Value, error(nil)
if err != nil {
return err
}
m.IdAttr = &parsed
}
if attr.Name.Local == "on" {
m.OnAttr.UnmarshalXMLAttr(attr)
}
if attr.Name.Local == "offset" {
parsed, err := attr.Value, error(nil)
if err != nil {
return err
}
m.OffsetAttr = &parsed
}
if attr.Name.Local == "origin" {
parsed, err := attr.Value, error(nil)
if err != nil {
return err
}
m.OriginAttr = &parsed
}
if attr.Name.Local == "matrix" {
parsed, err := attr.Value, error(nil)
if err != nil {
return err
}
m.MatrixAttr = &parsed
}
if attr.Name.Local == "ext" {
m.ExtAttr.UnmarshalXMLAttr(attr)
}
}
// skip any extensions we may find, but don't support
for {
tok, err := d.Token()
if err != nil {
return fmt.Errorf("parsing OfcSkew: %s", err)
}
if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name {
break
}
}
return nil
}
// Validate validates the OfcSkew and its children
func (m *OfcSkew) Validate() error {
return m.ValidateWithPath("OfcSkew")
}
// ValidateWithPath validates the OfcSkew and its children, prefixing error messages with path
func (m *OfcSkew) ValidateWithPath(path string) error {
if err := m.OfcCT_Skew.ValidateWithPath(path); err != nil {
return err
}
return nil
}