()
| 243 | } |
| 244 | |
| 245 | func (h *NodeNavigator) NodeType() xpath.NodeType { |
| 246 | switch h.curr.Type { |
| 247 | case html.CommentNode: |
| 248 | return xpath.CommentNode |
| 249 | case html.TextNode: |
| 250 | return xpath.TextNode |
| 251 | case html.DocumentNode: |
| 252 | return xpath.RootNode |
| 253 | case html.ElementNode: |
| 254 | if h.attr != -1 { |
| 255 | return xpath.AttributeNode |
| 256 | } |
| 257 | return xpath.ElementNode |
| 258 | case html.DoctypeNode: |
| 259 | // ignored <!DOCTYPE HTML> declare and as Root-Node type. |
| 260 | return xpath.RootNode |
| 261 | } |
| 262 | panic(fmt.Sprintf("unknown HTML node type: %v", h.curr.Type)) |
| 263 | } |
| 264 | |
| 265 | func (h *NodeNavigator) LocalName() string { |
| 266 | if h.attr != -1 { |
no outgoing calls