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

Method ReadFromString

etree.go:402–410  ·  view source on GitHub ↗

ReadFromString reads XML from the string 's' into this document.

(s string)

Source from the content-addressed store, hash-verified

400
401// ReadFromString reads XML from the string 's' into this document.
402func (d *Document) ReadFromString(s string) error {
403 if d.ReadSettings.ValidateInput {
404 if err := validateXML(strings.NewReader(s), d.ReadSettings); err != nil {
405 return err
406 }
407 }
408 _, err := d.Element.readFrom(strings.NewReader(s), d.ReadSettings)
409 return err
410}
411
412// validateXML determines if the data read from the reader 'r' contains
413// well-formed XML according to the rules set by the go xml package.

Callers 15

newDocumentFromString2Function · 0.95
TestImbalancedXMLFunction · 0.95
TestEmbeddedCommentFunction · 0.95
TestFuzzInjectionFunction · 0.95
TestCdataFunction · 0.95
TestCharDataFunction · 0.95
TestAttrParentFunction · 0.95

Calls 2

validateXMLFunction · 0.85
readFromMethod · 0.80

Tested by 15

newDocumentFromString2Function · 0.76
TestImbalancedXMLFunction · 0.76
TestEmbeddedCommentFunction · 0.76
TestFuzzInjectionFunction · 0.76
TestCdataFunction · 0.76
TestCharDataFunction · 0.76
TestAttrParentFunction · 0.76