encoding/xml: Marshal fails to handle conflicting tags #18564
Labels
Documentation
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?tip and 1.7.4
(this is not a regression)
What operating system and processor architecture are you using (
go env
)?linux/amd64
What did you do?
https://play.golang.org/p/w6DV-tXCwT
What did you expect to see?
<A><name2></name2></A>
What did you see instead?
xml: name "name1" in tag of main.A.B conflicts with name "name2" in main.B.XMLName
https://golang.org/pkg/encoding/xml/#Marshal lists the order of preference for the name of an element.
The example works if you remove the tag name1 or name2. This means the order of preferences (name1,name3) and (name2,name3) are working, but (name1,name2) is not.
The text was updated successfully, but these errors were encountered: