]> Cypherpunks repositories - gostls13.git/commit
encoding/xml: name space bug fixes
authorRuss Cox <rsc@golang.org>
Tue, 12 Mar 2013 15:46:12 +0000 (11:46 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 12 Mar 2013 15:46:12 +0000 (11:46 -0400)
commit4dd3e1e844cfab83b73b4ca417a0095ae7b0ef66
tree3471d0d05936992480e1466d8bd0dcfa7d8774ef
parent0d559f7b92c1425b9a78ff67933a9baaa0534928
encoding/xml: name space bug fixes

If two fields have the same name but different explicit name spaces,
treat as non-conflicting. This allows parsing common XML formats
that have ns1:tag and ns2:tag in the same XML element.
Fixes #4691.

Allow setting the default name space for unadorned tags, by
writing to Decoder.DefaultSpace. This allows turned the job of
parsing common XML formats that have tag and ns2:tag in the
same XML element into the first case by setting DefaultSpace="ns1".
Fixes #3703.

Use name space attributes when decoding.
Attach name space to attributes when encoding.
Could be done with fewer annotations, but semantically correct as is.
Fixes #3526.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7227056
src/pkg/encoding/xml/marshal.go
src/pkg/encoding/xml/read.go
src/pkg/encoding/xml/read_test.go
src/pkg/encoding/xml/typeinfo.go
src/pkg/encoding/xml/xml.go