suggestion: include missing namespace in error message
torkelrogstad opened this issue · comments
Torkel Rogstad commented
In the parsing logic, xmlquery errors out if a namespace is missing:
Lines 117 to 121 in 67c6eff
The error message here is not very helpful. I'd suggest doing this instead:
if space := tok.Name.Space; space != "" {
if _, found := p.space2prefix[space]; !found && p.decoder.Strict {
return nil, fmt.Errorf("xmlquery: invalid XML document, namespace %s is missing", space)
}
}