unmarshalInterface unmarshals a single XML element into val. start is the opening tag of the element.
(val Unmarshaler, start *StartElement)
| 204 | // unmarshalInterface unmarshals a single XML element into val. |
| 205 | // start is the opening tag of the element. |
| 206 | func (d *Decoder) unmarshalInterface(val Unmarshaler, start *StartElement) error { |
| 207 | // Record that decoder must stop at end tag corresponding to start. |
| 208 | d.pushEOF() |
| 209 | |
| 210 | d.unmarshalDepth++ |
| 211 | err := val.UnmarshalXML(d, *start) |
| 212 | d.unmarshalDepth-- |
| 213 | if err != nil { |
| 214 | d.popEOF() |
| 215 | return err |
| 216 | } |
| 217 | |
| 218 | if !d.popEOF() { |
| 219 | return fmt.Errorf("xml: %s.UnmarshalXML did not consume entire <%s> element", receiverType(val), start.Name.Local) |
| 220 | } |
| 221 | |
| 222 | return nil |
| 223 | } |
| 224 | |
| 225 | // unmarshalTextInterface unmarshals a single XML element into val. |
| 226 | // The chardata contained in the element (but not its children) |
no test coverage detected