AddChild adds child to the XMLNode.
(child *XMLNode)
| 30 | |
| 31 | // AddChild adds child to the XMLNode. |
| 32 | func (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. |
| 42 | func XMLToStruct(d *xml.Decoder, s *xml.StartElement, ignoreIndentation bool) (*XMLNode, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected