I am observing that the only xml documents that pass
validation are those in which the element order matches
exactly the order of their declaration in the generated
Is that the expected behavior ?
"validation" is an act of checking a document against a schema. If a schema requires things to be a certain order, then validation makes sure that a document follows it. So that's the expected behavior.
I think your question is really about whether JAXB should be generating a schema that requires elements to be in a particular order, and the answer is that we pretty much have to, due to the shortcomings in XML Schema.
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.