ReadFromBytes reads XML from the byte slice 'b' into the this document.
(b []byte)
| 389 | |
| 390 | // ReadFromBytes reads XML from the byte slice 'b' into the this document. |
| 391 | func (d *Document) ReadFromBytes(b []byte) error { |
| 392 | if d.ReadSettings.ValidateInput { |
| 393 | if err := validateXML(bytes.NewReader(b), d.ReadSettings); err != nil { |
| 394 | return err |
| 395 | } |
| 396 | } |
| 397 | _, err := d.Element.readFrom(bytes.NewReader(b), d.ReadSettings) |
| 398 | return err |
| 399 | } |
| 400 | |
| 401 | // ReadFromString reads XML from the string 's' into this document. |
| 402 | func (d *Document) ReadFromString(s string) error { |