diff --git a/operator.go b/operator.go index 8c2f31f..eb38ac6 100644 --- a/operator.go +++ b/operator.go @@ -165,15 +165,28 @@ func cmpNodeSetString(t iterator, op string, m, n interface{}) bool { func cmpNodeSetNodeSet(t iterator, op string, m, n interface{}) bool { a := m.(query) b := n.(query) - x := a.Select(t) - if x == nil { - return false - } - y := b.Select(t) - if y == nil { - return false + for { + x := a.Select(t) + if x == nil { + return false + } + + y := b.Select(t) + if y == nil { + return false + } + + for { + if cmpStringStringF(op, x.Value(), y.Value()) { + return true + } + if y = b.Select(t); y == nil { + break + } + } + // reset + b.Evaluate(t) } - return cmpStringStringF(op, x.Value(), y.Value()) } func cmpStringNumeric(t iterator, op string, m, n interface{}) bool {