Closed w65536 closed 2 years ago
Looks like merging your earlier PRs made this one enter into a conflict again @w65536
Conflict resolved. I had inadvertently introduced a problem in commit 8a6ef869c463ef931de19b57cde914b97c038fc0 when arranging various commits for separate pull requests. By resolving the merge conflict, this problem "automatically" goes away.
Great, thanks Patrick!
This fixes #224.
The problem was initially addressed with PR #109 (issue #73) in commit dd8f1cae4f65c55c7ddca89a21925dd9d85ad14e. However that commit does not address all possible name mismatch scenarios.
If multiple elements with different names are of the same complexType, the existing logic arbitrarily takes the first element's name for the struct's XMLName field tag. All other elements with different names then conflict with that tag.
Errors would typically look like these:
"xml: name \"order\" in tag of example.AckType.Order conflicts with name \"orderType\" in *example.OrderType.XMLName"
"expected element type <historyType> but have <history>"
This PR proposes two changes:
Both changes are required to solve all conflicting cases.
Test fixtures are adapted and verified for this change.