MCPcopy Create free account
hub / github.com/beevik/etree / ReadFromFile

Method ReadFromFile

etree.go:378–387  ·  view source on GitHub ↗

ReadFromFile reads XML from a local file at path 'filepath' into this document.

(filepath string)

Source from the content-addressed store, hash-verified

376// ReadFromFile reads XML from a local file at path 'filepath' into this
377// document.
378func (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.
390func (d *Document) ReadFromBytes(b []byte) error {

Callers 2

TestValidateInputFunction · 0.95
ExampleDocument_readingFunction · 0.95

Calls 1

ReadFromMethod · 0.95

Tested by 2

TestValidateInputFunction · 0.76
ExampleDocument_readingFunction · 0.76