FindOne is like Query but panics if `expr` is not a valid XPath expression. See `Query()` function.
(top *Node, expr string)
| 76 | // FindOne is like Query but panics if `expr` is not a valid XPath expression. |
| 77 | // See `Query()` function. |
| 78 | func FindOne(top *Node, expr string) *Node { |
| 79 | node, err := Query(top, expr) |
| 80 | if err != nil { |
| 81 | panic(err) |
| 82 | } |
| 83 | return node |
| 84 | } |
| 85 | |
| 86 | // QueryAll searches the XML Node that matches by the specified XPath expr. |
| 87 | // Returns an error if the expression `expr` cannot be parsed. |
searching dependent graphs…