Skip to content

encoding/xml: failure to handle conflicting tags in different namespaces #8535

Closed
@jbardin

Description

@jbardin
What does 'go version' print?

go1.3.1

What steps reproduce the problem?

Try to decode document with the same tag in multiple namespaces
<example>
    <title>Example</title>
    <link>http://example.com/default<;/link>
    <ns:link xmlns:ns="http://www.w3.org/2005/Atom";>http://example.com/ns<;/ns:link>
</example>`

http://play.golang.org/p/FT56UXolGO


What happened?
main.Example field "Link" with tag "link" conflicts with field
"AtomLink" with tag "http://www.w3.org/2005/Atom link"

What should have happened instead?

It should be possible to decode both tags in this document.

Also, if the name-spaced tag isn't provided, the second "link" element shadows
the first though it's in another namespace.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions