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: marshaling/unmarshaling with namespace produces different results #21079

Closed
syphoxy opened this issue Jul 19, 2017 · 3 comments
Closed

Comments

@syphoxy
Copy link

syphoxy commented Jul 19, 2017

Please answer these questions before submitting your issue. Thanks!

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

go version go1.6.4 linux/amd64

Note: I did try this with go 1.8.3 and the issue still persists.

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/spyroboy/.go"
GORACE=""
GOROOT="/usr/lib/golang"
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"

What did you do?

I'm trying to Marshal and Unmarshal XML data but it appears that there are discrepancies between how XML is parsed and how XML is generated.

What did you expect to see?

I expect that generating data is the same as parsing data.

What did you see instead?

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

@syphoxy
Copy link
Author

syphoxy commented Jul 19, 2017

modifying the input string here to remove the attributes produces interesting results as well

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

@mvdan
Copy link
Member

mvdan commented Jul 19, 2017

I'm fairly sure this is a dup of #13400.

@syphoxy
Copy link
Author

syphoxy commented Jul 20, 2017

yeah it appears to be. sorry about that. I hope my playground example will help in finding a solution.

@mvdan mvdan closed this as completed Jul 20, 2017
@golang golang locked and limited conversation to collaborators Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants