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

Function selectNodes

xpath_test.go:330–343  ·  view source on GitHub ↗
(root *TNode, expr string)

Source from the content-addressed store, hash-verified

328}
329
330func selectNodes(root *TNode, expr string) []*TNode {
331 t := Select(createNavigator(root), expr)
332 c := make(map[uint64]bool)
333 var list []*TNode
334 for _, n := range iterateNodes(t) {
335 m := getHashCode(createNavigator(n))
336 if _, ok := c[m]; ok {
337 continue
338 }
339 c[m] = true
340 list = append(list, n)
341 }
342 return list
343}
344
345func joinValues(nodes []*TNode) string {
346 s := make([]string, 0)

Callers 5

test_xpath_elementsFunction · 0.85
test_xpath_valuesFunction · 0.85
test_xpath_tagsFunction · 0.85
test_xpath_countFunction · 0.85
selectNodeFunction · 0.85

Calls 4

SelectFunction · 0.85
createNavigatorFunction · 0.85
iterateNodesFunction · 0.85
getHashCodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…