59 lines
1.4 KiB
Go
Raw Normal View History

// Copyright 2017 FoxyUtils ehf. All rights reserved.
2017-08-28 20:56:18 -05:00
//
// DO NOT EDIT: generated by gooxml ECMA-376 generator
//
2017-08-28 20:56:18 -05:00
// 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 elements
import (
"encoding/xml"
"fmt"
)
2017-08-29 16:55:03 -05:00
type Any struct {
2017-08-28 20:56:18 -05:00
SimpleLiteral
}
2017-08-29 16:55:03 -05:00
func NewAny() *Any {
ret := &Any{}
2017-08-28 20:56:18 -05:00
ret.SimpleLiteral = *NewSimpleLiteral()
return ret
}
2017-08-29 16:55:03 -05:00
func (m *Any) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
2017-08-28 20:56:18 -05:00
return m.SimpleLiteral.MarshalXML(e, start)
}
2017-08-29 16:55:03 -05:00
func (m *Any) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
2017-08-28 20:56:18 -05:00
// initialize to default
m.SimpleLiteral = *NewSimpleLiteral()
// skip any extensions we may find, but don't support
for {
tok, err := d.Token()
if err != nil {
2017-08-29 16:55:03 -05:00
return fmt.Errorf("parsing Any: %s", err)
2017-08-28 20:56:18 -05:00
}
if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name {
break
}
}
return nil
}
// Validate validates the Any and its children
2017-08-29 16:55:03 -05:00
func (m *Any) Validate() error {
return m.ValidateWithPath("Any")
2017-08-28 20:56:18 -05:00
}
// ValidateWithPath validates the Any and its children, prefixing error messages with path
2017-08-29 16:55:03 -05:00
func (m *Any) ValidateWithPath(path string) error {
2017-08-28 20:56:18 -05:00
if err := m.SimpleLiteral.ValidateWithPath(path); err != nil {
return err
}
return nil
}