mirror of
https://github.com/unidoc/unioffice.git
synced 2025-04-25 13:48:53 +08:00
42 lines
9.8 KiB
Go
42 lines
9.8 KiB
Go
//
|
|
// Copyright 2020 FoxyUtils ehf. All rights reserved.
|
|
//
|
|
// This is a commercial product and requires a license to operate.
|
|
// A trial license can be obtained at https://unidoc.io
|
|
//
|
|
// DO NOT EDIT: generated by unitwist Go source code obfuscator.
|
|
//
|
|
// Use of this source code is governed by the UniDoc End User License Agreement
|
|
// terms that can be accessed at https://unidoc.io/eula/
|
|
|
|
package elements ;import (_a "encoding/xml";_e "fmt";_d "github.com/unidoc/unioffice";_b "github.com/unidoc/unioffice/common/logger";);func NewElementContainer ()*ElementContainer {_eg :=&ElementContainer {};return _eg };func (_f *Any )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_f .SimpleLiteral =*NewSimpleLiteral ();for {_da ,_c :=d .Token ();if _c !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0041\u006e\u0079\u003a\u0020\u0025\u0073",_c );};if _gf ,_bf :=_da .(_a .EndElement );_bf &&_gf .Name ==start .Name {break ;};};return nil ;};type SimpleLiteral struct{};
|
|
|
|
// ValidateWithPath validates the Any and its children, prefixing error messages with path
|
|
func (_ff *Any )ValidateWithPath (path string )error {if _gfa :=_ff .SimpleLiteral .ValidateWithPath (path );_gfa !=nil {return _gfa ;};return nil ;};func (_ffb *ElementsGroupChoice )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_dbe :for {_fg ,_df :=d .Token ();if _df !=nil {return _df ;};switch _ea :=_fg .(type ){case _a .StartElement :switch _ea .Name {case _a .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_bcd :=NewAny ();if _cgb :=d .DecodeElement (_bcd ,&_ea );_cgb !=nil {return _cgb ;};_ffb .Any =append (_ffb .Any ,_bcd );default:_b .Log .Debug ("\u0073\u006b\u0069\u0070\u0070\u0069\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070o\u0072\u0074\u0065\u0064\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020o\u006e\u0020\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072ou\u0070\u0043\u0068\u006f\u0069\u0063\u0065\u0020\u0025\u0076",_ea .Name );if _dab :=d .Skip ();_dab !=nil {return _dab ;};};case _a .EndElement :break _dbe ;case _a .CharData :};};return nil ;};func (_ed *Any )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {return _ed .SimpleLiteral .MarshalXML (e ,start );};func (_de *ElementContainer )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_ad :for {_dc ,_cf :=d .Token ();if _cf !=nil {return _cf ;};switch _fa :=_dc .(type ){case _a .StartElement :switch _fa .Name {case _a .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_af :=NewElementsGroupChoice ();if _ec :=d .DecodeElement (&_af .Any ,&_fa );_ec !=nil {return _ec ;};_de .Choice =append (_de .Choice ,_af );default:_b .Log .Debug ("\u0073\u006b\u0069\u0070\u0070i\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065d\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072\u0020\u0025v",_fa .Name );if _db :=d .Skip ();_db !=nil {return _db ;};};case _a .EndElement :break _ad ;case _a .CharData :};};return nil ;};func NewElementsGroup ()*ElementsGroup {_bec :=&ElementsGroup {};return _bec };
|
|
|
|
// ValidateWithPath validates the ElementsGroup and its children, prefixing error messages with path
|
|
func (_edcc *ElementsGroup )ValidateWithPath (path string )error {for _abb ,_ag :=range _edcc .Choice {if _fd :=_ag .ValidateWithPath (_e .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_abb ));_fd !=nil {return _fd ;};};return nil ;};type ElementsGroupChoice struct{Any []*Any ;};
|
|
|
|
// Validate validates the Any and its children
|
|
func (_ba *Any )Validate ()error {return _ba .ValidateWithPath ("\u0041\u006e\u0079")};func NewAny ()*Any {_eb :=&Any {};_eb .SimpleLiteral =*NewSimpleLiteral ();return _eb };type ElementsGroup struct{Choice []*ElementsGroupChoice ;};func (_cc *ElementContainer )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {start .Name .Local ="\u0065\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072";e .EncodeToken (start );if _cc .Choice !=nil {for _ ,_bag :=range _cc .Choice {_bag .MarshalXML (e ,_a .StartElement {});};};e .EncodeToken (_a .EndElement {Name :start .Name });return nil ;};
|
|
|
|
// Validate validates the ElementsGroupChoice and its children
|
|
func (_ga *ElementsGroupChoice )Validate ()error {return _ga .ValidateWithPath ("\u0045\u006c\u0065\u006den\u0074\u0073\u0047\u0072\u006f\u0075\u0070\u0043\u0068\u006f\u0069\u0063\u0065");};func (_fae *ElementsGroupChoice )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {if _fae .Any !=nil {_cbf :=_a .StartElement {Name :_a .Name {Local :"\u0064\u0063\u003a\u0061\u006e\u0079"}};for _ ,_begb :=range _fae .Any {e .EncodeElement (_begb ,_cbf );};};return nil ;};func (_ged *SimpleLiteral )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {e .EncodeToken (start );e .EncodeToken (_a .EndElement {Name :start .Name });return nil ;};
|
|
|
|
// ValidateWithPath validates the SimpleLiteral and its children, prefixing error messages with path
|
|
func (_gc *SimpleLiteral )ValidateWithPath (path string )error {return nil };func NewElementsGroupChoice ()*ElementsGroupChoice {_cfg :=&ElementsGroupChoice {};return _cfg };func NewSimpleLiteral ()*SimpleLiteral {_fb :=&SimpleLiteral {};return _fb };func (_ab *ElementsGroup )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {if _ab .Choice !=nil {for _ ,_afb :=range _ab .Choice {_afb .MarshalXML (e ,_a .StartElement {});};};return nil ;};type ElementContainer struct{Choice []*ElementsGroupChoice ;};
|
|
|
|
// ValidateWithPath validates the ElementsGroupChoice and its children, prefixing error messages with path
|
|
func (_dcd *ElementsGroupChoice )ValidateWithPath (path string )error {for _bce ,_ffe :=range _dcd .Any {if _ggd :=_ffe .ValidateWithPath (_e .Sprintf ("\u0025\u0073\u002f\u0041\u006e\u0079\u005b\u0025\u0064\u005d",path ,_bce ));_ggd !=nil {return _ggd ;};};return nil ;};func (_cb *ElementsGroup )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_edc :for {_bffd ,_ge :=d .Token ();if _ge !=nil {return _ge ;};switch _gee :=_bffd .(type ){case _a .StartElement :switch _gee .Name {case _a .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_ee :=NewElementsGroupChoice ();if _cgd :=d .DecodeElement (&_ee .Any ,&_gee );_cgd !=nil {return _cgd ;};_cb .Choice =append (_cb .Choice ,_ee );default:_b .Log .Debug ("\u0073\u006b\u0069\u0070\u0070\u0069\u006e\u0067 \u0075\u006e\u0073up\u0070\u006f\u0072\u0074\u0065\u0064 \u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0045\u006c\u0065\u006de\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070 \u0025\u0076",_gee .Name );if _bc :=d .Skip ();_bc !=nil {return _bc ;};};case _a .EndElement :break _edc ;case _a .CharData :};};return nil ;};
|
|
|
|
// Validate validates the SimpleLiteral and its children
|
|
func (_ffa *SimpleLiteral )Validate ()error {return _ffa .ValidateWithPath ("\u0053\u0069\u006d\u0070\u006c\u0065\u004c\u0069\u0074\u0065\u0072\u0061\u006c");};func (_dfd *SimpleLiteral )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {for {_fe ,_ecg :=d .Token ();if _ecg !=nil {return _e .Errorf ("\u0070a\u0072\u0073\u0069\u006eg\u0020\u0053\u0069\u006d\u0070l\u0065L\u0069t\u0065\u0072\u0061\u006c\u003a\u0020\u0025s",_ecg );};if _fed ,_fdd :=_fe .(_a .EndElement );_fdd &&_fed .Name ==start .Name {break ;};};return nil ;};type Any struct{SimpleLiteral };
|
|
|
|
// Validate validates the ElementContainer and its children
|
|
func (_gg *ElementContainer )Validate ()error {return _gg .ValidateWithPath ("\u0045\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072");};
|
|
|
|
// ValidateWithPath validates the ElementContainer and its children, prefixing error messages with path
|
|
func (_bb *ElementContainer )ValidateWithPath (path string )error {for _gd ,_bff :=range _bb .Choice {if _adg :=_bff .ValidateWithPath (_e .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_gd ));_adg !=nil {return _adg ;};};return nil ;};
|
|
|
|
// Validate validates the ElementsGroup and its children
|
|
func (_daf *ElementsGroup )Validate ()error {return _daf .ValidateWithPath ("\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070");};func init (){_d .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f","\u0053\u0069\u006d\u0070\u006c\u0065\u004c\u0069\u0074\u0065\u0072\u0061\u006c",NewSimpleLiteral );_d .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f","\u0065\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072",NewElementContainer );_d .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f","\u0061\u006e\u0079",NewAny );_d .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f","\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070",NewElementsGroup );}; |