Skip to content
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 · 5 comments
Open

encoding/xml: Allow ",any" elements to be unmarshalled as raw xml #6825

x6j8x opened this issue Nov 23, 2013 · 5 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@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
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 1:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 2:

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

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 3:

Labels changed: added repo-main.

@x6j8x
Copy link
Author

x6j8x commented Feb 13, 2014

Comment 4:

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

@malimohub
Copy link

this would be nice for sure

@seankhliao seankhliao added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants