Im not sure this is valid xml, unfortunately its what I'm having to deal with - looking for suggestions on how to accomplish.
my xml looks like this:
<report>
<sort>
<field>type<order>ascending</order></field>
</sort>
</report>
I am attempting to unmarshall into the following structs:
type Sort struct {
Field string `xml:"field"`
Order string `xml:"field>order"`
}
type Report struct {
Sort Sort `xml:"sort"`
}
unfortunately this is throwing the error:
Unmarshalling error: v7.Sort field "Field" with tag "field" conflicts with field "Order" with tag "field>order"
Is there a built in way of achieving this or am I looking at some custom unmarshalling
UPDATE: At least according to this answer it appears this should be valid if slightly ugly xml: Can a XML element contain text and child elements at the same time?