// Custom unmarshalling to provide default value to "schema" attribute, when unavailable
Custom unmarshalling to provide default value to "schema" attribute, when unavailable
// Custom unmarshalling to provide default value to " schema " attribute when unavailable
func (ms *MatchSignal) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
	type dupMatchSignalType MatchSignal
	matchSignal := dupMatchSignalType{}
	err := d.DecodeElement(&matchSignal, &start)
	if err != nil {
		return err
	}
	if strings.Trim(matchSignal.Schema, " ") == "" {
		matchSignal.Schema = matchSignalSchemaDefault
	}
	*ms = MatchSignal(matchSignal)
	return nil
}
func ( ms * MatchSignal ) UnmarshalXML ( d * xml . Decoder , start xml . StartElement ) error { type dupMatchSignalType MatchSignal matchSignal := dupMatchSignalType { } err := d . DecodeElement ( & matchSignal , & start ) if err != nil { return err } if strings . Trim ( matchSignal . Schema , " " ) == " " { matchSignal . Schema = matchSignalSchemaDefault } * ms = MatchSignal ( matchSignal ) return nil }
Custom unmarshalling to provide default value to "schema" attribute, when unavailable
Custom unmarshalling to provide default value to " schema " attribute when unavailable
/**
	* https://pkg.go.dev/encoding/xml#Unmarshaler
	* One common implementation strategy is to unmarshal into a separate value with a layout matching the expected XML using d.DecodeElement,
	* and then to copy the data from that value into the receiver.
	* this is to prevent recursive unmarshaling ending in an infinite loop
	 */ // set the default value