Skip to content

encoding/xml: No way of creating self terminating nodes with MarshalXML #6896

Closed
@nemith

Description

@nemith
What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. http://play.golang.org/p/o20RjaRdtQ
2.
3.

What is the expected output?

It would be preferable to get
<RPCElementTarget><running/></RPCElementTarget>

What do you see instead?

There is no way to do self terminating elements.  The best we can do is to do a start
and end element with no chardata.  This does not work for my application.  The closest
output is:
<RPCElementTarget><running></running></RPCElementTarget>

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

Which operating system are you using?
OS X 10.9

Which version are you using?  (run 'go version')
go version go1.2 darwin/amd64

Please provide any additional information below.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions