mirror of
https://github.com/unidoc/unioffice.git
synced 2025-04-25 13:48:53 +08:00
36 lines
14 KiB
Go
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 (_ec "encoding/xml";_c "fmt";_b "github.com/unidoc/unioffice";_a "github.com/unidoc/unioffice/common/logger";);
|
|
|
|
// ValidateWithPath validates the Relationships and its children, prefixing error messages with path
|
|
func (_fca *Relationships )ValidateWithPath (path string )error {if _cf :=_fca .CT_Relationships .ValidateWithPath (path );_cf !=nil {return _cf ;};return nil ;};func (_bba *Relationships )UnmarshalXML (d *_ec .Decoder ,start _ec .StartElement )error {_bba .CT_Relationships =*NewCT_Relationships ();_acc :for {_ccc ,_ab :=d .Token ();if _ab !=nil {return _ab ;};switch _gg :=_ccc .(type ){case _ec .StartElement :switch _gg .Name {case _ec .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"}:_gfa :=NewRelationship ();if _adc :=d .DecodeElement (_gfa ,&_gg );_adc !=nil {return _adc ;};_bba .Relationship =append (_bba .Relationship ,_gfa );default:_a .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",_gg .Name );if _ge :=d .Skip ();_ge !=nil {return _ge ;};};case _ec .EndElement :break _acc ;case _ec .CharData :};};return nil ;};func (_fd *CT_Relationships )MarshalXML (e *_ec .Encoder ,start _ec .StartElement )error {e .EncodeToken (start );if _fd .Relationship !=nil {_gfg :=_ec .StartElement {Name :_ec .Name {Local :"\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070"}};for _ ,_ee :=range _fd .Relationship {e .EncodeElement (_ee ,_gfg );};};e .EncodeToken (_ec .EndElement {Name :start .Name });return nil ;};
|
|
|
|
// Validate validates the CT_Relationship and its children
|
|
func (_def *CT_Relationship )Validate ()error {return _def .ValidateWithPath ("\u0043T\u005fR\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070");};func (_ba *Relationship )UnmarshalXML (d *_ec .Decoder ,start _ec .StartElement )error {_ba .CT_Relationship =*NewCT_Relationship ();for _ ,_eba :=range start .Attr {if _eba .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074\u004d\u006f\u0064\u0065"{_ba .TargetModeAttr .UnmarshalXMLAttr (_eba );continue ;};if _eba .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074"{_fe ,_df :=_eba .Value ,error (nil );if _df !=nil {return _df ;};_ba .TargetAttr =_fe ;continue ;};if _eba .Name .Local =="\u0054\u0079\u0070\u0065"{_ccg ,_fcb :=_eba .Value ,error (nil );if _fcb !=nil {return _fcb ;};_ba .TypeAttr =_ccg ;continue ;};if _eba .Name .Local =="\u0049\u0064"{_eg ,_cd :=_eba .Value ,error (nil );if _cd !=nil {return _cd ;};_ba .IdAttr =_eg ;continue ;};};for {_dcd ,_ea :=d .Token ();if _ea !=nil {return _c .Errorf ("\u0070a\u0072\u0073\u0069\u006e\u0067\u0020\u0052\u0065\u006c\u0061\u0074i\u006f\u006e\u0073\u0068\u0069\u0070\u003a\u0020\u0025\u0073",_ea );};if _ag ,_ff :=_dcd .(_ec .EndElement );_ff &&_ag .Name ==start .Name {break ;};};return nil ;};
|
|
|
|
// Validate validates the Relationship and its children
|
|
func (_ebde *Relationship )Validate ()error {return _ebde .ValidateWithPath ("\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070");};
|
|
|
|
// ValidateWithPath validates the CT_Relationship and its children, prefixing error messages with path
|
|
func (_beb *CT_Relationship )ValidateWithPath (path string )error {if _cga :=_beb .TargetModeAttr .ValidateWithPath (path +"\u002fT\u0061r\u0067\u0065\u0074\u004d\u006f\u0064\u0065\u0041\u0074\u0074\u0072");_cga !=nil {return _cga ;};return nil ;};func (_ebf *ST_TargetMode )UnmarshalXML (d *_ec .Decoder ,start _ec .StartElement )error {_accb ,_efce :=d .Token ();if _efce !=nil {return _efce ;};if _bed ,_gag :=_accb .(_ec .EndElement );_gag &&_bed .Name ==start .Name {*_ebf =1;return nil ;};if _cfe ,_fdg :=_accb .(_ec .CharData );!_fdg {return _c .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",_accb );}else {switch string (_cfe ){case "":*_ebf =0;case "\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c":*_ebf =1;case "\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c":*_ebf =2;};};_accb ,_efce =d .Token ();if _efce !=nil {return _efce ;};if _aa ,_ed :=_accb .(_ec .EndElement );_ed &&_aa .Name ==start .Name {return nil ;};return _c .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",_accb );};
|
|
|
|
// Validate validates the Relationships and its children
|
|
func (_dea *Relationships )Validate ()error {return _dea .ValidateWithPath ("\u0052\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073");};func (_eagc *ST_TargetMode )UnmarshalXMLAttr (attr _ec .Attr )error {switch attr .Value {case "":*_eagc =0;case "\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c":*_eagc =1;case "\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c":*_eagc =2;};return nil ;};type CT_Relationship struct{TargetModeAttr ST_TargetMode ;TargetAttr string ;TypeAttr string ;IdAttr string ;Content string ;};type ST_TargetMode byte ;func (_gfaf ST_TargetMode )ValidateWithPath (path string )error {switch _gfaf {case 0,1,2:default:return _c .Errorf ("\u0025s\u003a\u0020\u006f\u0075t\u0020\u006f\u0066\u0020\u0072a\u006eg\u0065 \u0076\u0061\u006c\u0075\u0065\u0020\u0025d",path ,int (_gfaf ));};return nil ;};func (_ebaf ST_TargetMode )MarshalXML (e *_ec .Encoder ,start _ec .StartElement )error {return e .EncodeElement (_ebaf .String (),start );};
|
|
|
|
// ValidateWithPath validates the Relationship and its children, prefixing error messages with path
|
|
func (_efc *Relationship )ValidateWithPath (path string )error {if _bdg :=_efc .CT_Relationship .ValidateWithPath (path );_bdg !=nil {return _bdg ;};return nil ;};
|
|
|
|
// ValidateWithPath validates the CT_Relationships and its children, prefixing error messages with path
|
|
func (_cgb *CT_Relationships )ValidateWithPath (path string )error {for _ebd ,_bd :=range _cgb .Relationship {if _dcbg :=_bd .ValidateWithPath (_c .Sprintf ("\u0025\u0073\u002f\u0052el\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u005b\u0025\u0064\u005d",path ,_ebd ));_dcbg !=nil {return _dcbg ;};};return nil ;};type CT_Relationships struct{Relationship []*Relationship ;};func (_dc *CT_Relationship )MarshalXML (e *_ec .Encoder ,start _ec .StartElement )error {if _dc .TargetModeAttr !=ST_TargetModeUnset {_ae ,_be :=_dc .TargetModeAttr .MarshalXMLAttr (_ec .Name {Local :"\u0054\u0061\u0072\u0067\u0065\u0074\u004d\u006f\u0064\u0065"});if _be !=nil {return _be ;};start .Attr =append (start .Attr ,_ae );};start .Attr =append (start .Attr ,_ec .Attr {Name :_ec .Name {Local :"\u0054\u0061\u0072\u0067\u0065\u0074"},Value :_c .Sprintf ("\u0025\u0076",_dc .TargetAttr )});start .Attr =append (start .Attr ,_ec .Attr {Name :_ec .Name {Local :"\u0054\u0079\u0070\u0065"},Value :_c .Sprintf ("\u0025\u0076",_dc .TypeAttr )});start .Attr =append (start .Attr ,_ec .Attr {Name :_ec .Name {Local :"\u0049\u0064"},Value :_c .Sprintf ("\u0025\u0076",_dc .IdAttr )});e .EncodeElement (_dc .Content ,start );e .EncodeToken (_ec .EndElement {Name :start .Name });return nil ;};func (_bbc *Relationships )MarshalXML (e *_ec .Encoder ,start _ec .StartElement )error {start .Attr =append (start .Attr ,_ec .Attr {Name :_ec .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 ,_ec .Attr {Name :_ec .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 _bbc .CT_Relationships .MarshalXML (e ,start );};const (ST_TargetModeUnset ST_TargetMode =0;ST_TargetModeExternal ST_TargetMode =1;ST_TargetModeInternal ST_TargetMode =2;);func (_aac ST_TargetMode )String ()string {switch _aac {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 "";};func (_f *CT_Relationship )UnmarshalXML (d *_ec .Decoder ,start _ec .StartElement )error {for _ ,_bb :=range start .Attr {if _bb .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074\u004d\u006f\u0064\u0065"{_f .TargetModeAttr .UnmarshalXMLAttr (_bb );continue ;};if _bb .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074"{_fc ,_cg :=_bb .Value ,error (nil );if _cg !=nil {return _cg ;};_f .TargetAttr =_fc ;continue ;};if _bb .Name .Local =="\u0054\u0079\u0070\u0065"{_g ,_da :=_bb .Value ,error (nil );if _da !=nil {return _da ;};_f .TypeAttr =_g ;continue ;};if _bb .Name .Local =="\u0049\u0064"{_daa ,_de :=_bb .Value ,error (nil );if _de !=nil {return _de ;};_f .IdAttr =_daa ;continue ;};};for {_dg ,_bbf :=d .Token ();if _bbf !=nil {return _c .Errorf ("p\u0061\u0072\u0073\u0069\u006e\u0067 \u0043\u0054\u005f\u0052\u0065\u006c\u0061\u0074\u0069o\u006e\u0073\u0068i\u0070:\u0020\u0025\u0073",_bbf );};if _dd ,_bbd :=_dg .(_ec .CharData );_bbd {_f .Content =string (_dd );};if _gf ,_eb :=_dg .(_ec .EndElement );_eb &&_gf .Name ==start .Name {break ;};};return nil ;};func (_cc *Relationship )MarshalXML (e *_ec .Encoder ,start _ec .StartElement )error {return _cc .CT_Relationship .MarshalXML (e ,start );};func NewRelationships ()*Relationships {_eag :=&Relationships {};_eag .CT_Relationships =*NewCT_Relationships ();return _eag ;};type Relationships struct{CT_Relationships };func NewCT_Relationship ()*CT_Relationship {_d :=&CT_Relationship {};return _d };func NewRelationship ()*Relationship {_dda :=&Relationship {};_dda .CT_Relationship =*NewCT_Relationship ();return _dda ;};func (_gea ST_TargetMode )MarshalXMLAttr (name _ec .Name )(_ec .Attr ,error ){_dfa :=_ec .Attr {};_dfa .Name =name ;switch _gea {case ST_TargetModeUnset :_dfa .Value ="";case ST_TargetModeExternal :_dfa .Value ="\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c";case ST_TargetModeInternal :_dfa .Value ="\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c";};return _dfa ,nil ;};func NewCT_Relationships ()*CT_Relationships {_dge :=&CT_Relationships {};return _dge };func (_ac *CT_Relationships )UnmarshalXML (d *_ec .Decoder ,start _ec .StartElement )error {_ecg :for {_daaa ,_dgec :=d .Token ();if _dgec !=nil {return _dgec ;};switch _dcb :=_daaa .(type ){case _ec .StartElement :switch _dcb .Name {case _ec .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"}:_fb :=NewRelationship ();if _ad :=d .DecodeElement (_fb ,&_dcb );_ad !=nil {return _ad ;};_ac .Relationship =append (_ac .Relationship ,_fb );default:_a .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",_dcb .Name );if _gb :=d .Skip ();_gb !=nil {return _gb ;};};case _ec .EndElement :break _ecg ;case _ec .CharData :};};return nil ;};func (_ace ST_TargetMode )Validate ()error {return _ace .ValidateWithPath ("")};type Relationship struct{CT_Relationship };
|
|
|
|
// Validate validates the CT_Relationships and its children
|
|
func (_af *CT_Relationships )Validate ()error {return _af .ValidateWithPath ("\u0043\u0054_\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073");};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 );}; |