QueryAll searches the XML Node that matches by the specified XPath expr. Returns an error if the expression `expr` cannot be parsed.
(top *Node, expr string)
| 86 | // QueryAll searches the XML Node that matches by the specified XPath expr. |
| 87 | // Returns an error if the expression `expr` cannot be parsed. |
| 88 | func QueryAll(top *Node, expr string) ([]*Node, error) { |
| 89 | exp, err := getQuery(expr) |
| 90 | if err != nil { |
| 91 | return nil, err |
| 92 | } |
| 93 | return QuerySelectorAll(top, exp), nil |
| 94 | } |
| 95 | |
| 96 | // Query searches the XML Node that matches by the specified XPath expr, |
| 97 | // and returns first matched element. |
searching dependent graphs…