unioffice/schema/soo/pkg/relationships/relationships.go
2023-06-10 07:12:37 +00:00

36 lines
14 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 relationships ;import (_f "encoding/xml";_fb "fmt";_b "github.com/unidoc/unioffice";_gd "github.com/unidoc/unioffice/common/logger";);
// ValidateWithPath validates the CT_Relationship and its children, prefixing error messages with path
func (_ge *CT_Relationship )ValidateWithPath (path string )error {if _eb :=_ge .TargetModeAttr .ValidateWithPath (path +"\u002fT\u0061r\u0067\u0065\u0074\u004d\u006f\u0064\u0065\u0041\u0074\u0074\u0072");_eb !=nil {return _eb ;};return nil ;};func (_ceda *Relationship )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {_ceda .CT_Relationship =*NewCT_Relationship ();for _ ,_eba :=range start .Attr {if _eba .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074\u004d\u006f\u0064\u0065"{_ceda .TargetModeAttr .UnmarshalXMLAttr (_eba );continue ;};if _eba .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074"{_db ,_gda :=_eba .Value ,error (nil );if _gda !=nil {return _gda ;};_ceda .TargetAttr =_db ;continue ;};if _eba .Name .Local =="\u0054\u0079\u0070\u0065"{_gbg ,_ebcb :=_eba .Value ,error (nil );if _ebcb !=nil {return _ebcb ;};_ceda .TypeAttr =_gbg ;continue ;};if _eba .Name .Local =="\u0049\u0064"{_cg ,_cd :=_eba .Value ,error (nil );if _cd !=nil {return _cd ;};_ceda .IdAttr =_cg ;continue ;};};for {_ggc ,_dgg :=d .Token ();if _dgg !=nil {return _fb .Errorf ("\u0070a\u0072\u0073\u0069\u006e\u0067\u0020\u0052\u0065\u006c\u0061\u0074i\u006f\u006e\u0073\u0068\u0069\u0070\u003a\u0020\u0025\u0073",_dgg );};if _ggcb ,_efb :=_ggc .(_f .EndElement );_efb &&_ggcb .Name ==start .Name {break ;};};return nil ;};func (_ab *CT_Relationships )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {_ca :for {_dd ,_bbc :=d .Token ();if _bbc !=nil {return _bbc ;};switch _eff :=_dd .(type ){case _f .StartElement :switch _eff .Name {case _f .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s",Local :"\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070"}:_gg :=NewRelationship ();if _dg :=d .DecodeElement (_gg ,&_eff );_dg !=nil {return _dg ;};_ab .Relationship =append (_ab .Relationship ,_gg );default:_gd .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\u0043\u0054\u005f\u0052\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073\u0020\u0025v",_eff .Name );if _cab :=d .Skip ();_cab !=nil {return _cab ;};};case _f .EndElement :break _ca ;case _f .CharData :};};return nil ;};
// Validate validates the Relationships and its children
func (_ee *Relationships )Validate ()error {return _ee .ValidateWithPath ("\u0052\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073");};
// Validate validates the CT_Relationships and its children
func (_ag *CT_Relationships )Validate ()error {return _ag .ValidateWithPath ("\u0043\u0054_\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073");};
// Validate validates the Relationship and its children
func (_cc *Relationship )Validate ()error {return _cc .ValidateWithPath ("\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070");};func (_def ST_TargetMode )MarshalXMLAttr (name _f .Name )(_f .Attr ,error ){_ec :=_f .Attr {};_ec .Name =name ;switch _def {case ST_TargetModeUnset :_ec .Value ="";case ST_TargetModeExternal :_ec .Value ="\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c";case ST_TargetModeInternal :_ec .Value ="\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c";};return _ec ,nil ;};type Relationship struct{CT_Relationship };func (_bdb ST_TargetMode )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {return e .EncodeElement (_bdb .String (),start );};
// ValidateWithPath validates the Relationships and its children, prefixing error messages with path
func (_cgd *Relationships )ValidateWithPath (path string )error {if _efe :=_cgd .CT_Relationships .ValidateWithPath (path );_efe !=nil {return _efe ;};return nil ;};func (_bg ST_TargetMode )String ()string {switch _bg {case 0:return "";case 1:return "\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c";case 2:return "\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c";};return "";};
// Validate validates the CT_Relationship and its children
func (_cbf *CT_Relationship )Validate ()error {return _cbf .ValidateWithPath ("\u0043T\u005fR\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070");};func (_a *CT_Relationship )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {if _a .TargetModeAttr !=ST_TargetModeUnset {_bb ,_fe :=_a .TargetModeAttr .MarshalXMLAttr (_f .Name {Local :"\u0054\u0061\u0072\u0067\u0065\u0074\u004d\u006f\u0064\u0065"});if _fe !=nil {return _fe ;};start .Attr =append (start .Attr ,_bb );};start .Attr =append (start .Attr ,_f .Attr {Name :_f .Name {Local :"\u0054\u0061\u0072\u0067\u0065\u0074"},Value :_fb .Sprintf ("\u0025\u0076",_a .TargetAttr )});start .Attr =append (start .Attr ,_f .Attr {Name :_f .Name {Local :"\u0054\u0079\u0070\u0065"},Value :_fb .Sprintf ("\u0025\u0076",_a .TypeAttr )});start .Attr =append (start .Attr ,_f .Attr {Name :_f .Name {Local :"\u0049\u0064"},Value :_fb .Sprintf ("\u0025\u0076",_a .IdAttr )});e .EncodeElement (_a .Content ,start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};func (_d *CT_Relationship )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for _ ,_de :=range start .Attr {if _de .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074\u004d\u006f\u0064\u0065"{_d .TargetModeAttr .UnmarshalXMLAttr (_de );continue ;};if _de .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074"{_ga ,_fbf :=_de .Value ,error (nil );if _fbf !=nil {return _fbf ;};_d .TargetAttr =_ga ;continue ;};if _de .Name .Local =="\u0054\u0079\u0070\u0065"{_ce ,_ad :=_de .Value ,error (nil );if _ad !=nil {return _ad ;};_d .TypeAttr =_ce ;continue ;};if _de .Name .Local =="\u0049\u0064"{_gdc ,_ced :=_de .Value ,error (nil );if _ced !=nil {return _ced ;};_d .IdAttr =_gdc ;continue ;};};for {_e ,_bd :=d .Token ();if _bd !=nil {return _fb .Errorf ("p\u0061\u0072\u0073\u0069\u006e\u0067 \u0043\u0054\u005f\u0052\u0065\u006c\u0061\u0074\u0069o\u006e\u0073\u0068i\u0070:\u0020\u0025\u0073",_bd );};if _fbg ,_gb :=_e .(_f .CharData );_gb {_d .Content =string (_fbg );};if _ef ,_cb :=_e .(_f .EndElement );_cb &&_ef .Name ==start .Name {break ;};};return nil ;};func (_adg ST_TargetMode )Validate ()error {return _adg .ValidateWithPath ("")};func (_cea *ST_TargetMode )UnmarshalXMLAttr (attr _f .Attr )error {switch attr .Value {case "":*_cea =0;case "\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c":*_cea =1;case "\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c":*_cea =2;};return nil ;};func NewCT_Relationship ()*CT_Relationship {_c :=&CT_Relationship {};return _c };const (ST_TargetModeUnset ST_TargetMode =0;ST_TargetModeExternal ST_TargetMode =1;ST_TargetModeInternal ST_TargetMode =2;);type ST_TargetMode byte ;func NewRelationships ()*Relationships {_agb :=&Relationships {};_agb .CT_Relationships =*NewCT_Relationships ();return _agb ;};func NewCT_Relationships ()*CT_Relationships {_fec :=&CT_Relationships {};return _fec };func (_cda *ST_TargetMode )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {_bfc ,_bag :=d .Token ();if _bag !=nil {return _bag ;};if _ddeb ,_bc :=_bfc .(_f .EndElement );_bc &&_ddeb .Name ==start .Name {*_cda =1;return nil ;};if _defg ,_gfe :=_bfc .(_f .CharData );!_gfe {return _fb .Errorf ("\u0065\u0078\u0070\u0065\u0063\u0074\u0065\u0064\u0020\u0063\u0068a\u0072\u0020\u0064\u0061\u0074\u0061\u002c\u0020\u0067\u006ft\u0020\u0025\u0054",_bfc );}else {switch string (_defg ){case "":*_cda =0;case "\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c":*_cda =1;case "\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c":*_cda =2;};};_bfc ,_bag =d .Token ();if _bag !=nil {return _bag ;};if _cae ,_fef :=_bfc .(_f .EndElement );_fef &&_cae .Name ==start .Name {return nil ;};return _fb .Errorf ("\u0065\u0078\u0070\u0065c\u0074\u0065\u0064\u0020\u0065\u006e\u0064\u0020\u0065\u006ce\u006de\u006e\u0074\u002c\u0020\u0067\u006f\u0074 \u0025\u0076",_bfc );};func NewRelationship ()*Relationship {_afa :=&Relationship {};_afa .CT_Relationship =*NewCT_Relationship ();return _afa ;};
// ValidateWithPath validates the CT_Relationships and its children, prefixing error messages with path
func (_agd *CT_Relationships )ValidateWithPath (path string )error {for _dde ,_abc :=range _agd .Relationship {if _fea :=_abc .ValidateWithPath (_fb .Sprintf ("\u0025\u0073\u002f\u0052el\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u005b\u0025\u0064\u005d",path ,_dde ));_fea !=nil {return _fea ;};};return nil ;};func (_dfa *Relationships )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {_dfa .CT_Relationships =*NewCT_Relationships ();_gf :for {_ccb ,_cgb :=d .Token ();if _cgb !=nil {return _cgb ;};switch _ddc :=_ccb .(type ){case _f .StartElement :switch _ddc .Name {case _f .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s",Local :"\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070"}:_feg :=NewRelationship ();if _fd :=d .DecodeElement (_feg ,&_ddc );_fd !=nil {return _fd ;};_dfa .Relationship =append (_dfa .Relationship ,_feg );default:_gd .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\u0052\u0065\u006c\u0061t\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073 \u0025\u0076",_ddc .Name );if _gfc :=d .Skip ();_gfc !=nil {return _gfc ;};};case _f .EndElement :break _gf ;case _f .CharData :};};return nil ;};type CT_Relationship struct{TargetModeAttr ST_TargetMode ;TargetAttr string ;TypeAttr string ;IdAttr string ;Content string ;};func (_aba *Relationship )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {return _aba .CT_Relationship .MarshalXML (e ,start );};type CT_Relationships struct{Relationship []*Relationship ;};type Relationships struct{CT_Relationships };func (_gc ST_TargetMode )ValidateWithPath (path string )error {switch _gc {case 0,1,2:default:return _fb .Errorf ("\u0025s\u003a\u0020\u006f\u0075t\u0020\u006f\u0066\u0020\u0072a\u006eg\u0065 \u0076\u0061\u006c\u0075\u0065\u0020\u0025d",path ,int (_gc ));};return nil ;};func (_ae *Relationships )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Attr =append (start .Attr ,_f .Attr {Name :_f .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s"});start .Attr =append (start .Attr ,_f .Attr {Name :_f .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u006dl"},Value :"\u0068\u0074tp\u003a\u002f\u002fw\u0077\u0077\u002e\u00773.o\u0072g/\u0058\u004d\u004c\u002f\u0031\u0039\u00398/\u006e\u0061\u006d\u0065\u0073\u0070\u0061c\u0065"});start .Name .Local ="\u0052\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073";return _ae .CT_Relationships .MarshalXML (e ,start );};func (_bf *CT_Relationships )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {e .EncodeToken (start );if _bf .Relationship !=nil {_af :=_f .StartElement {Name :_f .Name {Local :"\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070"}};for _ ,_bdg :=range _bf .Relationship {e .EncodeElement (_bdg ,_af );};};e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};
// ValidateWithPath validates the Relationship and its children, prefixing error messages with path
func (_cdd *Relationship )ValidateWithPath (path string )error {if _be :=_cdd .CT_Relationship .ValidateWithPath (path );_be !=nil {return _be ;};return nil ;};func init (){_b .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s","\u0043\u0054_\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073",NewCT_Relationships );_b .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s","\u0043T\u005fR\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070",NewCT_Relationship );_b .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s","\u0052\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073",NewRelationships );_b .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s","\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070",NewRelationship );};