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

Method NodeType

query.go:155–172  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

153}
154
155func (x *NodeNavigator) NodeType() xpath.NodeType {
156 switch x.curr.Type {
157 case CommentNode:
158 return xpath.CommentNode
159 case TextNode, CharDataNode, NotationNode:
160 return xpath.TextNode
161 case DeclarationNode, DocumentNode:
162 return xpath.RootNode
163 case ElementNode:
164 if x.attr != -1 {
165 return xpath.AttributeNode
166 }
167 return xpath.ElementNode
168 case ProcessingInstruction: // Keep backward compatibility
169 return xpath.ElementNode
170 }
171 panic(fmt.Sprintf("unknown XML node type: %v", x.curr.Type))
172}
173
174func (x *NodeNavigator) LocalName() string {
175 if x.attr != -1 {

Callers 2

PrefixMethod · 0.95
getCurrentNodeFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected