MCPcopy Create free account
hub / github.com/aws/smithy-go / AddChild

Method AddChild

testing/xml/xmlToStruct.go:32–39  ·  view source on GitHub ↗

AddChild adds child to the XMLNode.

(child *XMLNode)

Source from the content-addressed store, hash-verified

30
31// AddChild adds child to the XMLNode.
32func (n *XMLNode) AddChild(child *XMLNode) {
33 child.parent = n
34 if _, ok := n.Children[child.Name.Local]; !ok {
35 // flattened will have multiple children with same tag name
36 n.Children[child.Name.Local] = []*XMLNode{}
37 }
38 n.Children[child.Name.Local] = append(n.Children[child.Name.Local], child)
39}
40
41// XMLToStruct converts a xml.Decoder stream to XMLNode with nested values.
42func XMLToStruct(d *xml.Decoder, s *xml.StartElement, ignoreIndentation bool) (*XMLNode, error) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected