1
0
mirror of https://github.com/golang/go synced 2024-10-05 18:21:21 -06:00
go/src/encoding
Russ Cox c0d6d332f6 encoding/xml: restore Go 1.4 name space behavior
There is clearly work to do here with respect to xml name spaces,
but I don't believe the changes in this cycle are clearly correct.
The changes in this cycle have visible impact on the generated xml,
possibly breaking existing programs, and yet it's not clear that they
are the end of the story: there is still significant confusion about how
name spaces work or should work (see #9519, #9775, #8167, #7113).

I would like to wait to make breaking changes until we completely
understand what the behavior should be and can evaluate the benefit
of those breaking changes. My main concern here is that we will break
programs in Go 1.5 for the sake of name space adjustments and then
while trying to fix those other bugs we'll break programs in Go 1.6 too.
Let's wait until we know all the changes we want to make before we
decide whether or how to break existing programs.

This CL reverts:

5ae822b encoding/xml: minor changes
bb7e665 encoding/xml: fix xmlns= behavior
9f9d66d encoding/xml: fix default namespace of tags
b69ea01 encoding/xml: fix namespaces in a>b tags
3be158d encoding/xml: encoding name spaces correctly

and adjusts tests from

a9dddb5 encoding/xml: add more EncodeToken tests.

to expect Go 1.4 behavior.

I have confirmed that the name space parts of the test suite
as of this CL passes against the Go 1.4 encoding/xml package,
indicating that this CL successfully restores the Go 1.4 behavior.

(Other tests do not, but that's because there were some real
bug fixes in this cycle that are being kept. Specifically, the
tests that don't pass in Go 1.4 are TestMarshal's NestedAndComment
case, TestEncodeToken's encoding of newlines, and
TestSimpleUseOfEncodeToken returning an error for invalid
token types.)

I also checked that the Go 1.4 tests pass when run against
this copy of the sources.

Fixes #11841.

Change-Id: I97de06761038b40388ef6e3a55547ff43edee7cb
Reviewed-on: https://go-review.googlesource.com/12570
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-07-27 16:03:38 +00:00
..
ascii85
asn1 encoding/asn1: don't parse invalid UTF-8. 2015-06-29 02:50:49 +00:00
base32
base64 encoding/base64: Optimize EncodeToString and DecodeString. 2015-04-24 01:45:43 +00:00
binary encoding/binary: update protobuf documentation link 2015-06-29 14:28:01 +00:00
csv encoding/csv: add examples for package 2015-06-22 11:11:37 +00:00
gob all: link to https for golang subdomains too 2015-07-12 04:42:40 +00:00
hex
json encoding/json: fix decoding of JSON null values 2015-07-22 15:39:54 +00:00
pem testing/quick: probabilistically generate nil pointers 2015-06-08 21:19:13 +00:00
xml encoding/xml: restore Go 1.4 name space behavior 2015-07-27 16:03:38 +00:00
encoding.go