Skip to content

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

Open
@x6j8x

Description

@x6j8x
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"`
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions