mirror of
https://github.com/unidoc/unioffice.git
synced 2025-05-10 19:29:15 +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 (_g "encoding/xml";_b "fmt";_c "github.com/unidoc/unioffice";);func (_cec ST_TargetMode )ValidateWithPath (path string )error {switch _cec {case 0,1,2:default:return _b .Errorf ("\u0025s\u003a\u0020\u006f\u0075t\u0020\u006f\u0066\u0020\u0072a\u006eg\u0065 \u0076\u0061\u006c\u0075\u0065\u0020\u0025d",path ,int (_cec ));};return nil ;};
|
|
|
|
// Validate validates the Relationships and its children
|
|
func (_dcg *Relationships )Validate ()error {return _dcg .ValidateWithPath ("\u0052\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073");};
|
|
|
|
// ValidateWithPath validates the CT_Relationship and its children, prefixing error messages with path
|
|
func (_eg *CT_Relationship )ValidateWithPath (path string )error {if _eb :=_eg .TargetModeAttr .ValidateWithPath (path +"\u002fT\u0061r\u0067\u0065\u0074\u004d\u006f\u0064\u0065\u0041\u0074\u0074\u0072");_eb !=nil {return _eb ;};return nil ;};func (_gab *Relationship )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {return _gab .CT_Relationship .MarshalXML (e ,start );};
|
|
|
|
// Validate validates the CT_Relationship and its children
|
|
func (_acf *CT_Relationship )Validate ()error {return _acf .ValidateWithPath ("\u0043T\u005fR\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070");};func NewCT_Relationship ()*CT_Relationship {_a :=&CT_Relationship {};return _a };type Relationships struct{CT_Relationships };func (_ef *Relationship )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_ef .CT_Relationship =*NewCT_Relationship ();for _ ,_gg :=range start .Attr {if _gg .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074\u004d\u006f\u0064\u0065"{_ef .TargetModeAttr .UnmarshalXMLAttr (_gg );continue ;};if _gg .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074"{_ag ,_fe :=_gg .Value ,error (nil );if _fe !=nil {return _fe ;};_ef .TargetAttr =_ag ;continue ;};if _gg .Name .Local =="\u0054\u0079\u0070\u0065"{_ae ,_fc :=_gg .Value ,error (nil );if _fc !=nil {return _fc ;};_ef .TypeAttr =_ae ;continue ;};if _gg .Name .Local =="\u0049\u0064"{_de ,_ebc :=_gg .Value ,error (nil );if _ebc !=nil {return _ebc ;};_ef .IdAttr =_de ;continue ;};};for {_af ,_gdb :=d .Token ();if _gdb !=nil {return _b .Errorf ("\u0070a\u0072\u0073\u0069\u006e\u0067\u0020\u0052\u0065\u006c\u0061\u0074i\u006f\u006e\u0073\u0068\u0069\u0070\u003a\u0020\u0025\u0073",_gdb );};if _eba ,_ad :=_af .(_g .EndElement );_ad &&_eba .Name ==start .Name {break ;};};return nil ;};func (_cga *CT_Relationships )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_df :for {_fg ,_ecce :=d .Token ();if _ecce !=nil {return _ecce ;};switch _dc :=_fg .(type ){case _g .StartElement :switch _dc .Name {case _g .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"}:_ca :=NewRelationship ();if _dfb :=d .DecodeElement (_ca ,&_dc );_dfb !=nil {return _dfb ;};_cga .Relationship =append (_cga .Relationship ,_ca );default:_c .Log ("\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",_dc .Name );if _aab :=d .Skip ();_aab !=nil {return _aab ;};};case _g .EndElement :break _df ;case _g .CharData :};};return nil ;};func (_gb ST_TargetMode )String ()string {switch _gb {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 (_dd *CT_Relationships )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {e .EncodeToken (start );if _dd .Relationship !=nil {_fa :=_g .StartElement {Name :_g .Name {Local :"\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070"}};for _ ,_cf :=range _dd .Relationship {e .EncodeElement (_cf ,_fa );};};e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};type ST_TargetMode byte ;func (_deg ST_TargetMode )MarshalXMLAttr (name _g .Name )(_g .Attr ,error ){_gc :=_g .Attr {};_gc .Name =name ;switch _deg {case ST_TargetModeUnset :_gc .Value ="";case ST_TargetModeExternal :_gc .Value ="\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c";case ST_TargetModeInternal :_gc .Value ="\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c";};return _gc ,nil ;};func (_baf *ST_TargetMode )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_daa ,_dfbdf :=d .Token ();if _dfbdf !=nil {return _dfbdf ;};if _be ,_cbf :=_daa .(_g .EndElement );_cbf &&_be .Name ==start .Name {*_baf =1;return nil ;};if _bg ,_ecb :=_daa .(_g .CharData );!_ecb {return _b .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",_daa );}else {switch string (_bg ){case "":*_baf =0;case "\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c":*_baf =1;case "\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c":*_baf =2;};};_daa ,_dfbdf =d .Token ();if _dfbdf !=nil {return _dfbdf ;};if _cc ,_baag :=_daa .(_g .EndElement );_baag &&_cc .Name ==start .Name {return nil ;};return _b .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",_daa );};func (_cea *Relationships )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_cea .CT_Relationships =*NewCT_Relationships ();_eaf :for {_egf ,_dee :=d .Token ();if _dee !=nil {return _dee ;};switch _dcc :=_egf .(type ){case _g .StartElement :switch _dcc .Name {case _g .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"}:_cfa :=NewRelationship ();if _dcb :=d .DecodeElement (_cfa ,&_dcc );_dcb !=nil {return _dcb ;};_cea .Relationship =append (_cea .Relationship ,_cfa );default:_c .Log ("\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",_dcc .Name );if _bfe :=d .Skip ();_bfe !=nil {return _bfe ;};};case _g .EndElement :break _eaf ;case _g .CharData :};};return nil ;};func NewCT_Relationships ()*CT_Relationships {_bc :=&CT_Relationships {};return _bc };type CT_Relationships struct{Relationship []*Relationship ;};func (_d *CT_Relationship )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for _ ,_aa :=range start .Attr {if _aa .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074\u004d\u006f\u0064\u0065"{_d .TargetModeAttr .UnmarshalXMLAttr (_aa );continue ;};if _aa .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074"{_bd ,_db :=_aa .Value ,error (nil );if _db !=nil {return _db ;};_d .TargetAttr =_bd ;continue ;};if _aa .Name .Local =="\u0054\u0079\u0070\u0065"{_cb ,_f :=_aa .Value ,error (nil );if _f !=nil {return _f ;};_d .TypeAttr =_cb ;continue ;};if _aa .Name .Local =="\u0049\u0064"{_ecd ,_gd :=_aa .Value ,error (nil );if _gd !=nil {return _gd ;};_d .IdAttr =_ecd ;continue ;};};for {_cd ,_ecc :=d .Token ();if _ecc !=nil {return _b .Errorf ("p\u0061\u0072\u0073\u0069\u006e\u0067 \u0043\u0054\u005f\u0052\u0065\u006c\u0061\u0074\u0069o\u006e\u0073\u0068i\u0070:\u0020\u0025\u0073",_ecc );};if _fd ,_da :=_cd .(_g .CharData );_da {_d .Content =string (_fd );};if _ga ,_ee :=_cd .(_g .EndElement );_ee &&_ga .Name ==start .Name {break ;};};return nil ;};
|
|
|
|
// ValidateWithPath validates the Relationships and its children, prefixing error messages with path
|
|
func (_gf *Relationships )ValidateWithPath (path string )error {if _dfa :=_gf .CT_Relationships .ValidateWithPath (path );_dfa !=nil {return _dfa ;};return nil ;};
|
|
|
|
// ValidateWithPath validates the CT_Relationships and its children, prefixing error messages with path
|
|
func (_ce *CT_Relationships )ValidateWithPath (path string )error {for _fgf ,_cgab :=range _ce .Relationship {if _ea :=_cgab .ValidateWithPath (_b .Sprintf ("\u0025\u0073\u002f\u0052el\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u005b\u0025\u0064\u005d",path ,_fgf ));_ea !=nil {return _ea ;};};return nil ;};const (ST_TargetModeUnset ST_TargetMode =0;ST_TargetModeExternal ST_TargetMode =1;ST_TargetModeInternal ST_TargetMode =2;);
|
|
|
|
// Validate validates the CT_Relationships and its children
|
|
func (_bf *CT_Relationships )Validate ()error {return _bf .ValidateWithPath ("\u0043\u0054_\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073");};func (_ec *CT_Relationship )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {if _ec .TargetModeAttr !=ST_TargetModeUnset {_ac ,_bb :=_ec .TargetModeAttr .MarshalXMLAttr (_g .Name {Local :"\u0054\u0061\u0072\u0067\u0065\u0074\u004d\u006f\u0064\u0065"});if _bb !=nil {return _bb ;};start .Attr =append (start .Attr ,_ac );};start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u0054\u0061\u0072\u0067\u0065\u0074"},Value :_b .Sprintf ("\u0025\u0076",_ec .TargetAttr )});start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u0054\u0079\u0070\u0065"},Value :_b .Sprintf ("\u0025\u0076",_ec .TypeAttr )});start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u0049\u0064"},Value :_b .Sprintf ("\u0025\u0076",_ec .IdAttr )});e .EncodeElement (_ec .Content ,start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func NewRelationships ()*Relationships {_cff :=&Relationships {};_cff .CT_Relationships =*NewCT_Relationships ();return _cff ;};type Relationship struct{CT_Relationship };func (_cbbd ST_TargetMode )Validate ()error {return _cbbd .ValidateWithPath ("")};
|
|
|
|
// Validate validates the Relationship and its children
|
|
func (_ge *Relationship )Validate ()error {return _ge .ValidateWithPath ("\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070");};func NewRelationship ()*Relationship {_dfbd :=&Relationship {};_dfbd .CT_Relationship =*NewCT_Relationship ();return _dfbd ;};func (_dfd ST_TargetMode )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {return e .EncodeElement (_dfd .String (),start );};func (_baa *ST_TargetMode )UnmarshalXMLAttr (attr _g .Attr )error {switch attr .Value {case "":*_baa =0;case "\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c":*_baa =1;case "\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c":*_baa =2;};return nil ;};func (_egc *Relationships )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Attr =append (start .Attr ,_g .Attr {Name :_g .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 ,_g .Attr {Name :_g .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 _egc .CT_Relationships .MarshalXML (e ,start );};type CT_Relationship struct{TargetModeAttr ST_TargetMode ;TargetAttr string ;TypeAttr string ;IdAttr string ;Content string ;};
|
|
|
|
// ValidateWithPath validates the Relationship and its children, prefixing error messages with path
|
|
func (_cbb *Relationship )ValidateWithPath (path string )error {if _dda :=_cbb .CT_Relationship .ValidateWithPath (path );_dda !=nil {return _dda ;};return nil ;};func init (){_c .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 );_c .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 );_c .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 );_c .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 );}; |