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

Function createElement

xpath_test.go:603–621  ·  view source on GitHub ↗
(line int, name string, children ...*TNode)

Source from the content-addressed store, hash-verified

601}
602
603func createElement(line int, name string, children ...*TNode) *TNode {
604 nodeType := ElementNode
605 if name == "" {
606 nodeType = RootNode
607 }
608 n := createNode(name, nodeType)
609 n.lines = line
610 for _, c := range children {
611 c.Parent = n
612 c.PrevSibling = n.LastChild
613 if c.PrevSibling == nil {
614 n.FirstChild = c
615 } else {
616 c.PrevSibling.NextSibling = c
617 }
618 n.LastChild = c
619 }
620 return n
621}
622
623func createBookExample() *TNode {
624 /*

Callers 3

createElementAttrFunction · 0.85
Test_ancestor_predicateFunction · 0.85

Calls 1

createNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…