Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

string comparison size error #80

Open
weienjun opened this issue Sep 23, 2022 · 1 comment
Open

string comparison size error #80

weienjun opened this issue Sep 23, 2022 · 1 comment
Labels

Comments

@weienjun
Copy link

weienjun commented Sep 23, 2022

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

}`

@zhengchun
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants