A long running project showed an unexpected behavior when upgrading from org.eclipse.persistence:org.eclipse.persistence.moxy:2.7.12
to org.eclipse.persistence:org.eclipse.persistence.moxy:2.7.13
when the whole generated XSD was shuffled by the fact that now the elements are generated in alphabetical order whereas with version 2.7.12
or prior the elements were generated in order of appearance.
Searching the documentation, the source code and even debugging did not bring up the reason by now. Any hint on why this changed, where you can read about it and what to do to avoid it is highly appreaciated.
I created a showcase project with only the minimal settings necessary to reproduce the behavior: moxy-schema-generation
The files version_2.7.12.xsd and version_2.7.13.xsd hold the generated output but can also easily be recreated by running the respective main classes.
The sorting was added to the master branch in February 2019 as a response to a bug ticket opened in January 2019. The fix was ported to the 2.7 branch only in May 2023. That was between the versions 2.7.12
and 2.7.13
.
If you are interested in the details, here is a link to the point in the code where the sorting happens.
As far as I'm aware, this is only a change in implementation details. The change should not affect the behaviour of the generated XSD schema. If it does, please check if your XML parser is working correctly.