Skip to content

encoding/xml: no way to extract value of tag when namespaced tag with same name occurs later #3703

@evmar

Description

@evmar
Briefly, there doesn't appear to be a way to get "bar" out of the following
XML:

<x>
<foo>bar</foo>
<unrelated:foo>...</unrelated:foo>
</x>

Matching on `xml:"foo"` grabs the latter unrelated tag.

Here's a runnable example exhibiting the problem:
  http://play.golang.org/p/m-17dw-fDn

This problem affects gdata feeds (Google APIs) which make heavy use of XML namespaces.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions