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: Allow ",any" elements to be unmarshalled as raw xml #6825

Open
x6j8x opened this Issue Nov 23, 2013 · 4 comments

Comments

Projects
None yet
3 participants
@x6j8x
Copy link

x6j8x commented Nov 23, 2013

It would be nice if the encoding/xml package would allow to unmarshal unknown / not
explicitly mapped XML elements as raw XML.

This could be achieved by either allowing to combine the ",innerxml" and
",any" tags for struct fields or by introducing a new tag ",anyxml"
or something similar.

Example:

type MyStruct struct {
    Name string   `xml:"name"`
    Rest []string `xml:",any,innerxml"`
}
@rsc

This comment has been minimized.

Copy link
Contributor

rsc commented Nov 27, 2013

Comment 1:

Labels changed: added go1.3maybe.

@rsc

This comment has been minimized.

Copy link
Contributor

rsc commented Dec 4, 2013

Comment 2:

Labels changed: added release-none, removed go1.3maybe.

@rsc

This comment has been minimized.

Copy link
Contributor

rsc commented Dec 4, 2013

Comment 3:

Labels changed: added repo-main.

@x6j8x

This comment has been minimized.

Copy link
Author

x6j8x commented Feb 13, 2014

Comment 4:

maybe use the same semantics as in https://golang.org/issue/6213
for json

@x6j8x x6j8x added new labels Feb 13, 2014

@bradfitz bradfitz removed the new label Dec 18, 2014

@rsc rsc added this to the Unplanned milestone Apr 10, 2015

@rsc rsc removed release-none labels Apr 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment