QuerySelector returns the first matched XML Node by the specified XPath selector.
(top *Node, selector *xpath.Expr)
| 117 | // QuerySelector returns the first matched XML Node by the specified XPath |
| 118 | // selector. |
| 119 | func QuerySelector(top *Node, selector *xpath.Expr) *Node { |
| 120 | t := selector.Select(CreateXPathNavigator(top)) |
| 121 | if t.MoveNext() { |
| 122 | return getCurrentNode(t) |
| 123 | } |
| 124 | return nil |
| 125 | } |
| 126 | |
| 127 | // FindEach searches the html.Node and calls functions cb. |
| 128 | // Important: this method is deprecated, instead, use for .. = range Find(){}. |
no test coverage detected
searching dependent graphs…