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

Method ReadFromString

etree.go:401–409  ·  view source on GitHub ↗

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

(s string)

Source from the content-addressed store, hash-verified

399
400// ReadFromString reads XML from the string 's' into this document.
401func (d *Document) ReadFromString(s string) error {
402 if d.ReadSettings.ValidateInput {
403 if err := validateXML(strings.NewReader(s), d.ReadSettings); err != nil {
404 return err
405 }
406 }
407 _, err := d.Element.readFrom(strings.NewReader(s), d.ReadSettings)
408 return err
409}
410
411// validateXML determines if the data read from the reader 'r' contains
412// 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