We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm trying to search for a node in a document I think my xpath query is correct in syntax but does not return any elements. The following test fails.
func TestLayerIDFinding(t *testing.T) { xm := `<?xml version="1.0" encoding="UTF-8"?><_signin.SignInButton X="28" Y="352" Width="320" Height="50" LayerID="7FD41E11-85C2-45CC-AFFA-E9D480F22503" />` node := xmldom.Must(xmldom.ParseXML(xm)) xpath := `//_signin.SignInButton[@LayerID="7FD41E11-85C2-45CC-AFFA-E9D480F22503"]` r := node.Root.QueryOne(xpath) if r == nil { t.Error("Could Not find element") } else { t.Log("Element found") } }
The text was updated successfully, but these errors were encountered:
I was able to get this to work by changing LayerID to id and using FindByID. Curious if I should stay away from xpath queries like this?
Sorry, something went wrong.
Seems to be a bug, that root node cannot be found using //... xpath.
//...
No branches or pull requests
I'm trying to search for a node in a document
I think my xpath query is correct in syntax but does not return any elements. The following test fails.
The text was updated successfully, but these errors were encountered: