xpath icon indicating copy to clipboard operation
xpath copied to clipboard

string comparison size error

Open weienjun opened this issue 1 year ago • 1 comments

use xmlquery find func, use string comparison size exist error, i think cmpStringStringF have bug。

example: test data: ab find expr: /res/value[data > "a"] expected: b output: a

`// operator.go func cmpNodeSetString(t iterator, op string, m, n interface{}) bool {

a := m.(query)
b := n.(string)
for {
	node := a.Select(t)
	if node == nil {
		break
	}
           // this is errror
	if cmpStringStringF(op, b, node.Value()) {
		return true
	}
            // this is should 
	//if cmpStringStringF(op, node.Value(),b) {
	//	return true
	//}
}
return false

}`

weienjun avatar Sep 23 '22 08:09 weienjun

Sorry, I need more test example, I cannot found any problem from these code.

zhengchun avatar Jan 26 '23 11:01 zhengchun