-
Notifications
You must be signed in to change notification settings - Fork 123
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
Validate XPath query before use it with the new bblfsh api #635
Comments
@ajnavarro, @bzz In function
if query == "" {
query = "//*"
}
return c.xpath.Execute(c.root, query) where c.xpath.Execute is exactly the function: So every time when we apply xpath via |
@kuba-- but we are not failing the query if the xpath is wrong, maybe we should fail on that case. |
It should be fixed by 3rd party package: https://github.com/antchfx/xpath/blob/master/xpath.go#L139 |
Related: bblfsh/sdk#332 |
If we switch to the package main
import (
. "gopkg.in/xmlpath.v2"
// . "github.com/antchfx/xpath"
)
func main() {
MustCompile("//*[@role=\"Return\"]")
MustCompile("BAD")
MustCompile("this is a totally crap. For sure not valid @xpath") // <----
} |
What shall we do with this? @ajnavarro |
we can close this as cannot be fixed from our side. |
More info here: https://github.com/bblfsh/sdk/blob/4ba719e80ab52f2d4da5ac8a6f4675687c6fe952/uast/query/xpath/xpath.go#L22
The text was updated successfully, but these errors were encountered: