From cfcbb4227fb20191e04eb8d7766ae6202f526afd Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 23 Dec 2020 09:57:37 -0800 Subject: libgo: update to Go1.16beta1 release This does not yet include support for the //go:embed directive added in this release. * Makefile.am (check-runtime): Don't create check-runtime-dir. (mostlyclean-local): Don't remove check-runtime-dir. (check-go-tool, check-vet): Copy in go.mod and modules.txt. (check-cgo-test, check-carchive-test): Add go.mod file. * Makefile.in: Regenerate. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/280172 --- libgo/go/encoding/xml/marshal.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libgo/go/encoding/xml/marshal.go') diff --git a/libgo/go/encoding/xml/marshal.go b/libgo/go/encoding/xml/marshal.go index 0554b0d..d8a04a9 100644 --- a/libgo/go/encoding/xml/marshal.go +++ b/libgo/go/encoding/xml/marshal.go @@ -345,8 +345,11 @@ func (p *printer) createAttrPrefix(url string) string { if prefix == "" || !isName([]byte(prefix)) || strings.Contains(prefix, ":") { prefix = "_" } - if strings.HasPrefix(prefix, "xml") { - // xmlanything is reserved. + // 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") { prefix = "_" + prefix } if p.attrNS[prefix] != "" { -- cgit v1.1