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

Function iterateNodes

xpath_test.go:298–320  ·  view source on GitHub ↗
(t *NodeIterator)

Source from the content-addressed store, hash-verified

296}
297
298func iterateNodes(t *NodeIterator) []*TNode {
299 var nodes []*TNode
300 for t.MoveNext() {
301 n := t.Current().(*TNodeNavigator)
302 if n.NodeType() == AttributeNode {
303 childNode := &TNode{
304 Type: TextNode,
305 Data: n.Value(),
306 }
307 nodes = append(nodes, &TNode{
308 Parent: n.curr,
309 Type: AttributeNode,
310 Data: n.LocalName(),
311 FirstChild: childNode,
312 LastChild: childNode,
313 })
314 } else {
315 nodes = append(nodes, n.curr)
316 }
317
318 }
319 return nodes
320}
321
322func selectNode(root *TNode, expr string) *TNode {
323 list := selectNodes(root, expr)

Callers 2

TestNamespacePrefixQueryFunction · 0.85
selectNodesFunction · 0.85

Calls 5

MoveNextMethod · 0.80
CurrentMethod · 0.65
NodeTypeMethod · 0.65
ValueMethod · 0.65
LocalNameMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…