Find is like QueryAll but panics if `expr` is not a valid XPath expression. See `QueryAll()` function.
(top *Node, expr string)
| 66 | // Find is like QueryAll but panics if `expr` is not a valid XPath expression. |
| 67 | // See `QueryAll()` function. |
| 68 | func 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. |
searching dependent graphs…