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

Method Select

query.go:1268–1292  ·  view source on GitHub ↗
(t iterator)

Source from the content-addressed store, hash-verified

1266}
1267
1268func (d *descendantOverDescendantQuery) Select(t iterator) NodeNavigator {
1269 for {
1270 if d.level == 0 {
1271 node := d.Input.Select(t)
1272 if node == nil {
1273 return nil
1274 }
1275 d.currentNode = node.Copy()
1276 d.posit = 0
1277 if d.MatchSelf && d.Predicate(d.currentNode) {
1278 d.posit = 1
1279 return d.currentNode
1280 }
1281 d.moveToFirstChild()
1282 } else if !d.moveUpUntilNext() {
1283 continue
1284 }
1285 for ok := true; ok; ok = d.moveToFirstChild() {
1286 if d.Predicate(d.currentNode) {
1287 d.posit++
1288 return d.currentNode
1289 }
1290 }
1291 }
1292}
1293
1294func (d *descendantOverDescendantQuery) Evaluate(t iterator) interface{} {
1295 d.Input.Evaluate(t)

Callers

nothing calls this directly

Calls 4

moveToFirstChildMethod · 0.95
moveUpUntilNextMethod · 0.95
SelectMethod · 0.65
CopyMethod · 0.65

Tested by

no test coverage detected