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: name space ignored on attribute #3526

Closed
rsc opened this issue Apr 13, 2012 · 19 comments
Closed

encoding/xml: name space ignored on attribute #3526

rsc opened this issue Apr 13, 2012 · 19 comments
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Apr 13, 2012

See.  http://play.golang.org/p/8ZsJ8ZzeIQ
The age attribute should (?) have a name space.
@niemeyer
Copy link
Contributor

Comment 1:

Yeah, and on the same vein it must also handle foo>bar,attr.

@niemeyer
Copy link
Contributor

Comment 2:

Owner changed to @niemeyer.

@gopherbot
Copy link

Comment 3 by chris.jones.yar:

A common example of this problem is the xml:lang attribute that appears in data formats
like XMPP's stanzas.

@gopherbot
Copy link

Comment 4 by krolaw:

Should foo>bar,attr be listed as a separate bug?  I was bitten by it today.

@gopherbot
Copy link

Comment 5 by chris.jones.yar:

They seem like separate bugs to me. I've started on a fix for this one, and it seems
like it won't fix the other problem.

@gopherbot
Copy link

Comment 6 by krolaw:

Ok, foo>bar,attr bug added - https://golang.org/issue/3688

@gopherbot
Copy link

Comment 7 by BeMasher:

Ran into this issue with atom feeds from the picasa gdata api. The album feed produces
entries with id nodes in the atom namespace and later id nodes in the gphoto namespace. 
With the namespace url being ignored in the field's tag the last decoded id node
regardless of namespace is decoded into it.

@rsc
Copy link
Contributor Author

rsc commented Sep 12, 2012

Comment 8:

Labels changed: added go1.1maybe.

@rsc
Copy link
Contributor Author

rsc commented Sep 14, 2012

Comment 9:

Labels changed: removed go1.1maybe.

@gopherbot
Copy link

Comment 10 by robin.gloster:

You can do so by supplying the namespace URL instead of the Prefix:
Content     string   `xml:"http://purl.org/rss/1.0/modules/content/ encoded"`
instead of
Content     string   `xml:"content:encoded"`

@gopherbot
Copy link

Comment 11 by chris.jones.yar:

https://golang.org/cl/6868044 addresses this.

@rsc
Copy link
Contributor Author

rsc commented Dec 10, 2012

Comment 12:

Labels changed: added size-l.

@gopherbot
Copy link

Comment 13 by sorin.ionescu:

Thank you, Chris, for the https://golang.org/cl/6868044 patch; it looks
promising. We are not there yet. While it can marshal namespaces, it cannot unmarshal
them.

@gopherbot
Copy link

Comment 14 by chris.jones.yar:

Can you expand on that a bit? I'm using this code to marshal and unmarshal XMPP traffic,
which uses namespaces quite a bit.
It's not important to me whether my patch is the one that fixes this bug; I'd just like
to see it fixed. But if nobody else is going to fix it, I'd appreciate an explanation of
what requirements my patch needs to meet in order to be accepted.

@anacrolix
Copy link
Contributor

Comment 15:

Welcome to "open source". :)

@rsc
Copy link
Contributor Author

rsc commented Mar 12, 2013

Comment 16:

https://golang.org/cl/7227056/

@gopherbot
Copy link

Comment 17 by cornelius.howl:

https://golang.org/cl/7350048/ Here is a simple patch.

@rsc
Copy link
Contributor Author

rsc commented Mar 12, 2013

Comment 18:

This issue was closed by revision 4dd3e1e.

Status changed to Fixed.

@gopherbot
Copy link

Comment 19:

CL https://golang.org/cl/6868044 references this issue.

@rsc rsc added fixed labels Apr 9, 2014
@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
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

4 participants