-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: createAttrPrefix should ban "XMLanything" case insensitive, not just "xmlanything" #35151
Comments
https://www.w3.org/TR/xml-names/ says
under 3 "Declaring Namespaces". Also https://www.w3.org/TR/REC-xml/ says
under "2.3 Common Syntactic Constructs". |
Change https://golang.org/cl/203417 mentions this issue: |
Can I help with anything? |
Ping. |
Thank you for filing this bug and for mailing the CL! I shall provide some feedback on your change, and awesome to have your contribution to the Go project! |
@tgulacsi I sent some feedback to your CL about 20 days ago, please take a look, so that we can get it going before the code freeze. Thank you. |
Sorry, haven't seen it. |
Change https://golang.org/cl/240012 mentions this issue: |
Change https://golang.org/cl/240179 mentions this issue: |
…tive" This reverts CL 203417. Reason for revert: This change changes uses of tags like "XMLSchema-instance" without any recourse. For #35151 Fixes #39876 Change-Id: I4c85c8267a46b3748664b5078794dafffb42aa26 Reviewed-on: https://go-review.googlesource.com/c/go/+/240179 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Andrew Bonventre <andybons@golang.org>
The change is rolled back in CL 240179. For #35151 For #39876 Change-Id: Id26ccbdb482772ac31c642156a9900102397b043 Reviewed-on: https://go-review.googlesource.com/c/go/+/240012 Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reopening and retargeting for Go1.16 to address the raised cause of rollback during Go1.15. |
Ping |
1 similar comment
Ping |
@tgulacsi A minor point, but if you want us to review a change, please ping the change, not the associated issue. Thanks. |
But now I'm not sure what is going on here. Is there a change to review? What is the ping for? Who are you pinging? |
I'd like some directions - my previous CL was reviewed, accepted, then reverted. Now I don't know what was the problem with it, what should I change to have it accepted - without information, I can only reissue the same CL. |
Change https://golang.org/cl/254978 mentions this issue: |
PTAL https://go-review.googlesource.com/c/go/+/254978 - it reintroduces the same code change, but puts it behind an Encoder option. |
@tgulacsi Thanks for the context. I look at dozens of different issues every day, so I can't always keep them all in my head. The CL that reverted your CL, https://golang.org/cl/240179, says "Reason for revert: This change changes uses of tags like "XMLSchema-instance" without any recourse" and refers to #39876. #39876 explains the problem, and you commented there. That issue has a test case whose behavior changed. Any change we make should not change the behavior of that test case, or other similar test cases. The Go project takes backward compatibility very seriously. We do not want to break existing programs. There needs to be a very good reason to not do that. Perhaps we made a mistake in the fix for #5040, but we still don't want to break existing programs. Worse, as #39876 says, after your earlier change (https://golang.org/cl/203417) there was no way for a program to get the string that it got before. So not only did the behavior change, there was no way to get the old behavior. In your new CL (https://golang.org/cl/254978) you are introducing new API: a new method But first let's take a step back. What is the real problem here that we are trying to solve? What goes wrong if we don't fix this? Perhaps you understand that, but I don't. Perhaps that can help guide us to the right solution. Thanks. |
From one of my clients, I got back this:
And https://www.w3.org/TR/REC-xml/ says she's right. That's what I try to solve. |
Sorry if this is a dumb question, but where is the string |
As far as I see, it's https://github.com/golang/go/blob/master/src/encoding/xml/marshal.go#L339 where it starts to pick a short name (tag?) for the namespace. If possible, it uses the namespace url's path's last section. AFAIK a random name would work, too - that's why I don't understand what does it break. |
@tgulacsi OK, I've looked into this, and I've come around to the view that you are correct: we should make this change and fix code that breaks. |
Thanks for your patience with this. |
Change https://golang.org/cl/264024 mentions this issue: |
Thank you @ianlancetaylor and @odeke-em ! The big thing is that I thought I can contribute to the Go project, and have a tiny improvement on Go, So thanks again for looking again into it, and rolling forward! |
Fixes the check for the reserved namespace prefix "xml" to be case insensitive, so as to match all variants of: (('X'|'x')('M'|'m')('L'|'l')) as mandated by Section 2.3 of https://www.w3.org/TR/REC-xml/ This is a roll forward of CL 203417, which was rolled back by CL 240179. We've decided that the roll back was incorrect, and any broken tests should be fixed. The original CL 203417 was by Tamás Gulácsi. Fixes #35151 For #39876 Change-Id: I2e6daa7aeb252531fba0b8a56086613e13059528 Reviewed-on: https://go-review.googlesource.com/c/go/+/264024 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
AFAIK yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/u1HWd2zff8x
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: