MCPcopy Create free account
hub / github.com/antchfx/xpath / AddChild

Method AddChild

doc_test.go:44–56  ·  view source on GitHub ↗
(n *Node)

Source from the content-addressed store, hash-verified

42}
43
44func (parent *Node) AddChild(n *Node) {
45 n.Parent = parent
46 n.NextSibling = nil
47 if parent.FirstChild == nil {
48 parent.FirstChild = n
49 n.PrevSibling = nil
50 } else {
51 parent.LastChild.NextSibling = n
52 n.PrevSibling = parent.LastChild
53 }
54
55 parent.LastChild = n
56}
57
58type NodeNavigator struct {
59 curr, root *Node

Callers 1

ExampleFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected