-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Labels
Description
I was expecting Parse
or Query
to error out if I were to pass in something completely invalid, but it falls all the way through instead:
func TestXmlParse_1(t *testing.T) {
//s := `<note>
//<to>John</to>
//<from>Smith</from>
//<heading>Reminder</heading>
//<body>Don't forget me this weekend!</body>
//</note>`
s := `{"NotXml":"ActuallyJson"}`
parse, err := xmlquery.Parse(strings.NewReader(s))
if err != nil {
println(err.Error())
t.Fail()
}
query, err := xmlquery.Query(parse, "//body/text()")
if err != nil {
println(err.Error())
t.Fail()
}
println(query.Data)
}
using:
- github.com/antchfx/xmlquery v1.3.11