// UnmarshalXML - decodes XML data.
321763
func (args *WriterArgs) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
	// Make subtype to avoid recursive UnmarshalXML().
	type subWriterArgs WriterArgs
	parsedArgs := subWriterArgs{}
	if err := d.DecodeElement(&parsedArgs, &start); err != nil {
		return err
	}

	parsedArgs.QuoteFields = strings.ToLower(parsedArgs.QuoteFields)
	switch parsedArgs.QuoteFields {
	case "":
		parsedArgs.QuoteFields = asneeded
	case always, asneeded:
	default:
		return errInvalidQuoteFields(fmt.Errorf("invalid QuoteFields '%v'", parsedArgs.QuoteFields))
	}

	switch len(parsedArgs.RecordDelimiter) {
	case 0:
		parsedArgs.RecordDelimiter = defaultRecordDelimiter
	case 1, 2:
	default:
		return fmt.Errorf("invalid RecordDelimiter '%v'", parsedArgs.RecordDelimiter)
	}

	switch len(parsedArgs.FieldDelimiter) {
	case 0:
		parsedArgs.FieldDelimiter = defaultFieldDelimiter
	case 1:
	default:
		return fmt.Errorf("invalid FieldDelimiter '%v'", parsedArgs.FieldDelimiter)
	}

	switch parsedArgs.QuoteCharacter {
	case "":
		parsedArgs.QuoteCharacter = defaultQuoteCharacter
	case defaultQuoteCharacter:
	default:
		return fmt.Errorf("unsupported QuoteCharacter '%v'", parsedArgs.QuoteCharacter)
	}

	switch parsedArgs.QuoteEscapeCharacter {
	case "":
		parsedArgs.QuoteEscapeCharacter = defaultQuoteEscapeCharacter
	case defaultQuoteEscapeCharacter:
	default:
		return fmt.Errorf("unsupported QuoteEscapeCharacter '%v'", parsedArgs.QuoteEscapeCharacter)
	}

	*args = WriterArgs(parsedArgs)
	args.unmarshaled = true
	return nil
}
773960
func (name *Name) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
	var s string
	if err := d.DecodeElement(&s, &start); err != nil {
		return err
	}

	eventName, err := ParseName(s)
	if err != nil {
		return err
	}

	*name = eventName
	return nil
}
1237032
func (t *Tree) Unmarshal(v interface{}) error {
	d := Decoder{tval: t, tagName: tagFieldName}
	return d.unmarshal(v)
}
985388
func (c *CurrSymbol) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
	return e.EncodeElement(c.String(), start)
}
596351
func (pipeList *PipeList) UnmarshalXML(decoder *xml.Decoder, start xml.StartElement) (err error) {
	content := ""

	if err = decoder.DecodeElement(&content, &start); err != nil {
		return err
	}

	*pipeList = strings.Split(strings.Trim(content, "|"), "|")

	return
}
1175862
func (c *CompressionType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
	var s string
	if err := d.DecodeElement(&s, &start); err != nil {
		return errMalformedXML(err)
	}

	parsedType := CompressionType(strings.ToLower(s))
	if s == "" {
		parsedType = noneType
	}

	switch parsedType {
	case noneType, gzipType, bzip2Type:
	default:
		return errInvalidCompressionFormat(fmt.Errorf("invalid compression format '%v'", s))
	}

	*c = parsedType
	return nil
}
338703
func (n *Node) UnmarshalText(text []byte) error {
	dec, err := ParseV4(string(text))
	if err == nil {
		*n = *dec
	}
	return err
}
63857
func (self *Coder) Unmarshal(in []byte, data interface{}) error {
	return self.unmarshaller(in, data)
}
1190854
func (a *Amount) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
	return e.EncodeElement(a.String(), start)
}
1138732
func (r *Request) ToXml(v interface{}) error {
	data, err := r.Bytes()
	if err != nil {
		return err
	}
	return xml.Unmarshal(data, v)
}
1274608
func (b *BoolWrapper) UnmarshalXMLAttr(attr xml.Attr) error {
	*b = false
	if strings.ToLower(attr.Value) == "true" {
		*b = true
	}

	return nil
}
558688
func (o *OOList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
	for {
		tok, err := nextNonWhitespaceToken(d)
		if err != nil {
			return err
		} else if end, ok := tok.(xml.EndElement); ok && end.Name.Local == start.Name.Local {
			// If we found the end of our starting element, we're done parsing
			return nil
		} else if startElement, ok := tok.(xml.StartElement); ok {
			switch startElement.Name.Local {
			case "OOBUYDEBT":
				var oo OOBuyDebt
				if err := d.DecodeElement(&oo, &startElement); err != nil {
					return err
				}
				*o = append(*o, OpenOrder(oo))
			case "OOBUYMF":
				var oo OOBuyMF
				if err := d.DecodeElement(&oo, &startElement); err != nil {
					return err
				}
				*o = append(*o, OpenOrder(oo))
			case "OOBUYOPT":
				var oo OOBuyOpt
				if err := d.DecodeElement(&oo, &startElement); err != nil {
					return err
				}
				*o = append(*o, OpenOrder(oo))
			case "OOBUYOTHER":
				var oo OOBuyOther
				if err := d.DecodeElement(&oo, &startElement); err != nil {
					return err
				}
				*o = append(*o, OpenOrder(oo))
			case "OOBUYSTOCK":
				var oo OOBuyStock
				if err := d.DecodeElement(&oo, &startElement); err != nil {
					return err
				}
				*o = append(*o, OpenOrder(oo))
			case "OOSELLDEBT":
				var oo OOSellDebt
				if err := d.DecodeElement(&oo, &startElement); err != nil {
					return err
				}
				*o = append(*o, OpenOrder(oo))
			case "OOSELLMF":
				var oo OOSellMF
				if err := d.DecodeElement(&oo, &startElement); err != nil {
					return err
				}
				*o = append(*o, OpenOrder(oo))
			case "OOSELLOPT":
				var oo OOSellOpt
				if err := d.DecodeElement(&oo, &startElement); err != nil {
					return err
				}
				*o = append(*o, OpenOrder(oo))
			case "OOSELLOTHER":
				var oo OOSellOther
				if err := d.DecodeElement(&oo, &startElement); err != nil {
					return err
				}
				*o = append(*o, OpenOrder(oo))
			case "OOSELLSTOCK":
				var oo OOSellStock
				if err := d.DecodeElement(&oo, &startElement); err != nil {
					return err
				}
				*o = append(*o, OpenOrder(oo))
			case "SWITCHMF":
				var oo OOSwitchMF
				if err := d.DecodeElement(&oo, &startElement); err != nil {
					return err
				}
				*o = append(*o, OpenOrder(oo))
			default:
				return errors.New("Invalid OOList child tag: " + startElement.Name.Local)
			}
		} else {
			return errors.New("Didn't find an opening element")
		}
	}
}
100512
func (filter *FilterRule) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
	// Make subtype to avoid recursive UnmarshalXML().
	type filterRule FilterRule
	rule := filterRule{}
	if err := d.DecodeElement(&rule, &start); err != nil {
		return err
	}

	if rule.Name != "prefix" && rule.Name != "suffix" {
		return &ErrInvalidFilterName{rule.Name}
	}

	if err := ValidateFilterRuleValue(filter.Value); err != nil {
		return err
	}

	*filter = FilterRule(rule)

	return nil
}
403470
func (msl *MessageSetList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
	for {
		var msgset MessageSet
		tok, err := nextNonWhitespaceToken(d)
		if err != nil {
			return err
		} else if end, ok := tok.(xml.EndElement); ok && end.Name.Local == start.Name.Local {
			// If we found the end of our starting element, we're done parsing
			return nil
		} else if _, ok := tok.(xml.StartElement); ok {
			// Found starting tag for <xxxMSGSET>. Get the next one (xxxMSGSETVn) and decode that struct
			tok, err := nextNonWhitespaceToken(d)
			if err != nil {
				return err
			} else if versionStart, ok := tok.(xml.StartElement); ok {
				if err := d.DecodeElement(&msgset, &versionStart); err != nil {
					return err
				}
			} else {
				return errors.New("Invalid MSGSETLIST formatting")
			}
			msgset.Name = msgset.XMLName.Local

			// Eat ending tags for <xxxMSGSET>
			tok, err = nextNonWhitespaceToken(d)
			if err != nil {
				return err
			} else if _, ok := tok.(xml.EndElement); !ok {
				return errors.New("Invalid MSGSETLIST formatting")
			}
		} else {
			return errors.New("MSGSETLIST didn't find an opening xxxMSGSETVn element")
		}
		*msl = MessageSetList(append(*(*[]MessageSet)(msl), msgset))
	}
}
631727
func (args *ReaderArgs) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
	// Make subtype to avoid recursive UnmarshalXML().
	type subReaderArgs ReaderArgs
	parsedArgs := subReaderArgs{}
	if err := d.DecodeElement(&parsedArgs, &start); err != nil {
		return err
	}

	args.unmarshaled = true
	return nil
}
870375
func (info *DefaultNodeInfo) Unmarshal(bs []byte) error {
	return cdc.UnmarshalBinaryBare(bs, info)
}
596610
func Unmarshal(r *request.Request) {
	defer r.HTTPResponse.Body.Close()
	if r.DataFilled() {
		decoder := xml.NewDecoder(r.HTTPResponse.Body)
		err := xmlutil.UnmarshalXML(r.Data, decoder, "")
		if err != nil {
			r.Error = awserr.NewRequestFailure(
				awserr.New("SerializationError", "failed decoding EC2 Query response", err),
				r.HTTPResponse.StatusCode,
				r.RequestID,
			)
			return
		}
	}
}