MCPcopy Create free account
hub / github.com/antchfx/xpath / Select

Method Select

query.go:241–267  ·  view source on GitHub ↗
(t iterator)

Source from the content-addressed store, hash-verified

239}
240
241func (a *attributeQuery) Select(t iterator) NodeNavigator {
242 for {
243 if a.iterator == nil {
244 node := a.Input.Select(t)
245 if node == nil {
246 return nil
247 }
248 node = node.Copy()
249 a.iterator = func() NodeNavigator {
250 for {
251 onAttr := node.MoveToNextAttribute()
252 if !onAttr {
253 return nil
254 }
255 if a.Predicate(node) {
256 return node
257 }
258 }
259 }
260 }
261
262 if node := a.iterator(); node != nil {
263 return node
264 }
265 a.iterator = nil
266 }
267}
268
269func (a *attributeQuery) Evaluate(t iterator) interface{} {
270 a.Input.Evaluate(t)

Callers

nothing calls this directly

Calls 3

SelectMethod · 0.65
CopyMethod · 0.65
MoveToNextAttributeMethod · 0.65

Tested by

no test coverage detected