Skip to content

encoding/xml: exported non-struct anonymous fields are not marshaled #3803

@gopherbot

Description

@gopherbot

by dcampbell24:

latest version of Go: 1.0.2

What steps will reproduce the problem?

http://play.golang.org/p/sYqNwtYeh5

What is the expected output?

<A><B>0<B/></A>

What do you see instead?
<A></A>

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Linux

Which version are you using?  (run 'go version')
weekly.2012-03-27 +100ddb84c85d

Please provide any additional information below.

The documentation for the xml package says that all exported fields are marshaled and
does not state any exception for embedded fields that are not structs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions