aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/xml/xml.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/encoding/xml/xml.go')
-rw-r--r--src/encoding/xml/xml.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/encoding/xml/xml.go b/src/encoding/xml/xml.go
index 8a0a9c253a..ef51252dcb 100644
--- a/src/encoding/xml/xml.go
+++ b/src/encoding/xml/xml.go
@@ -10,9 +10,6 @@ package xml
// Annotated XML spec: https://www.xml.com/axml/testaxml.htm
// XML name spaces: https://www.w3.org/TR/REC-xml-names/
-// TODO(rsc):
-// Test error handling.
-
import (
"bufio"
"bytes"
@@ -499,7 +496,7 @@ func (d *Decoder) popElement(t *EndElement) bool {
return false
case s.name.Space != name.Space:
d.err = d.syntaxError("element <" + s.name.Local + "> in space " + s.name.Space +
- "closed by </" + name.Local + "> in space " + name.Space)
+ " closed by </" + name.Local + "> in space " + name.Space)
return false
}
@@ -523,12 +520,11 @@ func (d *Decoder) autoClose(t Token) (Token, bool) {
if d.stk == nil || d.stk.kind != stkStart {
return nil, false
}
- name := strings.ToLower(d.stk.name.Local)
for _, s := range d.AutoClose {
- if strings.ToLower(s) == name {
+ if strings.EqualFold(s, d.stk.name.Local) {
// This one should be auto closed if t doesn't close it.
et, ok := t.(EndElement)
- if !ok || et.Name.Local != name {
+ if !ok || !strings.EqualFold(et.Name.Local, d.stk.name.Local) {
return EndElement{d.stk.name}, true
}
break