MCPcopy Create free account
hub / github.com/antchfx/xmlquery / getCurrentNode

Function getCurrentNode

query.go:48–64  ·  view source on GitHub ↗
(it *xpath.NodeIterator)

Source from the content-addressed store, hash-verified

46}
47
48func getCurrentNode(it *xpath.NodeIterator) *Node {
49 n := it.Current().(*NodeNavigator)
50 if n.NodeType() == xpath.AttributeNode {
51 childNode := &Node{
52 Type: TextNode,
53 Data: n.Value(),
54 }
55 return &Node{
56 Parent: n.curr,
57 Type: AttributeNode,
58 Data: n.LocalName(),
59 FirstChild: childNode,
60 LastChild: childNode,
61 }
62 }
63 return n.curr
64}
65
66// Find is like QueryAll but panics if `expr` is not a valid XPath expression.
67// See `QueryAll()` function.

Callers 2

QuerySelectorAllFunction · 0.85
QuerySelectorFunction · 0.85

Calls 4

CurrentMethod · 0.80
NodeTypeMethod · 0.80
ValueMethod · 0.80
LocalNameMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…