2019-07-25 19:43:46 +03:00
|
|
|
// Copyright 2017 FoxyUtils ehf. All rights reserved.
|
2017-08-28 20:56:18 -05:00
|
|
|
//
|
2017-09-09 10:21:47 -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
|
2019-08-02 13:49:16 +03:00
|
|
|
// commercial license can be purchased via https://unidoc.io website.
|
2017-08-28 20:56:18 -05:00
|
|
|
|
|
|
|
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-09-01 15:19:23 -05:00
|
|
|
|
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-09-01 15:19:23 -05:00
|
|
|
|
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
|
|
|
|
}
|
2017-09-01 15:19:23 -05:00
|
|
|
|
|
|
|
// 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
|
|
|
}
|
2017-09-01 15:19:23 -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
|
|
|
|
}
|