Lines Matching refs:unmarshal
24 // Unmarshal parses the XML-encoded data and stores the result in
29 // Because Unmarshal uses the reflect package, it can only assign
30 // to exported (upper case) fields. Unmarshal uses a case-sensitive
34 // Unmarshal maps an XML element to a struct using the following rules.
39 // ",innerxml", Unmarshal accumulates the raw XML nested inside the
43 // Unmarshal records the element name in that field.
47 // the given name (and, optionally, name space) or else Unmarshal
53 // Unmarshal records the attribute value in that field.
66 // the prefix of a tag formatted as "a" or "a>b>c", unmarshal
74 // explicit name tag as per the previous rule, unmarshal maps
78 // field without any mode flags (",attr", ",chardata", etc), Unmarshal
83 // unmarshal maps the sub-element to that struct field.
90 // Unmarshal maps an XML element to a string or []byte by saving the
94 // Unmarshal maps an attribute value to a string or []byte by saving
97 // Unmarshal maps an XML element to a slice by extending the length of
100 // Unmarshal maps an XML element or attribute value to a bool by
103 // Unmarshal maps an XML element or attribute value to an integer or
108 // Unmarshal maps an XML element to an xml.Name by recording the
111 // Unmarshal maps an XML element to a pointer by setting the pointer
114 func Unmarshal(data []byte, v interface{}) error {
118 // Decode works like xml.Unmarshal, except it reads the decoder
124 // DecodeElement works like xml.Unmarshal except that it takes
127 // but also wants to defer to Unmarshal for some elements.
131 return errors.New("non-pointer passed to Unmarshal")
133 return d.unmarshal(val.Elem(), start)
141 // Unmarshaler is the interface implemented by objects that can unmarshal
146 // If it returns an error, the outer call to Unmarshal stops and
149 // One common implementation strategy is to unmarshal into
160 // UnmarshalerAttr is the interface implemented by objects that can unmarshal
164 // If it returns an error, the outer call to Unmarshal stops and
271 // Unmarshal a single XML element into val.
272 func (p *Decoder) unmarshal(val reflect.Value, start *StartElement) error {
347 // future we may choose to unmarshal the start
374 if err := p.unmarshal(v.Index(n), start); err != nil {
485 if err := p.unmarshal(saveAny, &t); err != nil {
570 return errors.New("cannot unmarshal into " + dst0.Type().String())
608 // paths, and calls unmarshal on them.
626 // It's a perfect match, unmarshal the field.
627 return true, p.unmarshal(finfo.value(sv), start)