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

Function Find

query.go:68–74  ·  view source on GitHub ↗

Find is like QueryAll but panics if `expr` is not a valid XPath expression. See `QueryAll()` function.

(top *Node, expr string)

Source from the content-addressed store, hash-verified

66// Find is like QueryAll but panics if `expr` is not a valid XPath expression.
67// See `QueryAll()` function.
68func Find(top *Node, expr string) []*Node {
69 nodes, err := QueryAll(top, expr)
70 if err != nil {
71 panic(err)
72 }
73 return nodes
74}
75
76// FindOne is like Query but panics if `expr` is not a valid XPath expression.
77// See `Query()` function.

Callers 11

ExampleFunction · 0.92
TestDefaultNamespace_1Function · 0.85
TestDefaultNamespace_2Function · 0.85
TestDefaultNamespace_3Function · 0.85
TestDirectiveFunction · 0.85
SelectElementsMethod · 0.85
FindEachFunction · 0.85
FindEachWithBreakFunction · 0.85
TestXPathFunction · 0.85
TestAttributesNamespacesFunction · 0.85
TestMissingTextNodesFunction · 0.85

Calls 1

QueryAllFunction · 0.85

Tested by 8

ExampleFunction · 0.74
TestDefaultNamespace_1Function · 0.68
TestDefaultNamespace_2Function · 0.68
TestDefaultNamespace_3Function · 0.68
TestDirectiveFunction · 0.68
TestXPathFunction · 0.68
TestAttributesNamespacesFunction · 0.68
TestMissingTextNodesFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…