ReadFromFile reads XML from a local file at path 'filepath' into this document.
(filepath string)
| 376 | // ReadFromFile reads XML from a local file at path 'filepath' into this |
| 377 | // document. |
| 378 | func (d *Document) ReadFromFile(filepath string) error { |
| 379 | f, err := os.Open(filepath) |
| 380 | if err != nil { |
| 381 | return err |
| 382 | } |
| 383 | defer f.Close() |
| 384 | |
| 385 | _, err = d.ReadFrom(f) |
| 386 | return err |
| 387 | } |
| 388 | |
| 389 | // ReadFromBytes reads XML from the byte slice 'b' into the this document. |
| 390 | func (d *Document) ReadFromBytes(b []byte) error { |