MCPcopy Create free account
hub / github.com/antchfx/htmlquery / NodeType

Method NodeType

query.go:245–263  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

243}
244
245func (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
265func (h *NodeNavigator) LocalName() string {
266 if h.attr != -1 {

Callers 2

TestNavigatorFunction · 0.95
getCurrentNodeFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestNavigatorFunction · 0.76