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

Function Query

query.go:98–104  ·  view source on GitHub ↗

Query searches the XML Node that matches by the specified XPath expr, and returns first matched element.

(top *Node, expr string)

Source from the content-addressed store, hash-verified

96// Query searches the XML Node that matches by the specified XPath expr,
97// and returns first matched element.
98func Query(top *Node, expr string) (*Node, error) {
99 exp, err := getQuery(expr)
100 if err != nil {
101 return nil, err
102 }
103 return QuerySelector(top, exp), nil
104}
105
106// QuerySelectorAll searches all of the XML Node that matches the specified
107// XPath selectors.

Callers 3

FindOneFunction · 0.85
TestQueryWithPrefixFunction · 0.85

Calls 2

getQueryFunction · 0.85
QuerySelectorFunction · 0.85

Tested by 2

TestQueryWithPrefixFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…