diff options
Diffstat (limited to 'src/encoding/xml/marshal.go')
| -rw-r--r-- | src/encoding/xml/marshal.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/encoding/xml/marshal.go b/src/encoding/xml/marshal.go index d8a04a95a2..0554b0d204 100644 --- a/src/encoding/xml/marshal.go +++ b/src/encoding/xml/marshal.go @@ -345,11 +345,8 @@ func (p *printer) createAttrPrefix(url string) string { if prefix == "" || !isName([]byte(prefix)) || strings.Contains(prefix, ":") { prefix = "_" } - // xmlanything is reserved and any variant of it regardless of - // case should be matched, so: - // (('X'|'x') ('M'|'m') ('L'|'l')) - // See Section 2.3 of https://www.w3.org/TR/REC-xml/ - if len(prefix) >= 3 && strings.EqualFold(prefix[:3], "xml") { + if strings.HasPrefix(prefix, "xml") { + // xmlanything is reserved. prefix = "_" + prefix } if p.attrNS[prefix] != "" { |
