(it *xpath.NodeIterator)
| 46 | } |
| 47 | |
| 48 | func getCurrentNode(it *xpath.NodeIterator) *Node { |
| 49 | n := it.Current().(*NodeNavigator) |
| 50 | if n.NodeType() == xpath.AttributeNode { |
| 51 | childNode := &Node{ |
| 52 | Type: TextNode, |
| 53 | Data: n.Value(), |
| 54 | } |
| 55 | return &Node{ |
| 56 | Parent: n.curr, |
| 57 | Type: AttributeNode, |
| 58 | Data: n.LocalName(), |
| 59 | FirstChild: childNode, |
| 60 | LastChild: childNode, |
| 61 | } |
| 62 | } |
| 63 | return n.curr |
| 64 | } |
| 65 | |
| 66 | // Find is like QueryAll but panics if `expr` is not a valid XPath expression. |
| 67 | // See `QueryAll()` function. |
no test coverage detected
searching dependent graphs…