Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding/xml: createAttrPrefix should ban "XMLanything" case insensitive, not just "xmlanything" #35151

Open
tgulacsi opened this issue Oct 25, 2019 · 3 comments

Comments

@tgulacsi
Copy link

@tgulacsi tgulacsi commented Oct 25, 2019

What version of Go are you using (go version)?

$ go version
go version go1.13.3 linux/amd64

Does this issue reproduce with the latest release?

AFAIK yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN="/home/gthomas/bin"
GOCACHE="/home/gthomas/.cache/go-build"
GOENV="/home/gthomas/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY="unosoft.hu"
GONOSUMDB="unosoft.hu"
GOOS="linux"
GOPATH="/home/gthomas/go"
GOPRIVATE="unosoft.hu"
GOPROXY="http://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build491111576=/tmp/go-build -gno-record-gcc-switches"

What did you do?

https://play.golang.org/p/u1HWd2zff8x

What did you expect to see?

<element xmlns:_XMLSchema-instance="http://www.w3.org/2001/XMLSchema-instance" _XMLSchema-instance:nil="true"></element>

What did you see instead?

<element xmlns:XMLSchema-instance="http://www.w3.org/2001/XMLSchema-instance" XMLSchema-instance:nil="true"></element>
@tgulacsi

This comment has been minimized.

Copy link
Author

@tgulacsi tgulacsi commented Oct 25, 2019

https://www.w3.org/TR/xml-names/ says

All other prefixes beginning with the three-letter sequence x, m, l, in any case combination, are reserved.

under 3 "Declaring Namespaces".

Also https://www.w3.org/TR/REC-xml/ says

Names beginning with the string "xml", or with any string which would match (('X'|'x') ('M'|'m') ('L'|'l')), are reserved for standardization in this or future versions of this specification.

under "2.3 Common Syntactic Constructs".

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Oct 25, 2019

Change https://golang.org/cl/203417 mentions this issue: encoding/xml: namespace prefix case insensitive check

@tgulacsi

This comment has been minimized.

Copy link
Author

@tgulacsi tgulacsi commented Nov 2, 2019

Can I help with anything?
The second version of my CL is simpler and more explicit, I hope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.