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

Method ReadFromBytes

etree.go:391–399  ·  view source on GitHub ↗

ReadFromBytes reads XML from the byte slice 'b' into the this document.

(b []byte)

Source from the content-addressed store, hash-verified

389
390// ReadFromBytes reads XML from the byte slice 'b' into the this document.
391func (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.
402func (d *Document) ReadFromString(s string) error {

Callers 3

TestValidateInputFunction · 0.95
TestMaxDepthFunction · 0.95

Calls 2

validateXMLFunction · 0.85
readFromMethod · 0.80

Tested by 3

TestValidateInputFunction · 0.76
TestMaxDepthFunction · 0.76