jQuery in Action, 2nd edition*
The moose likes EJB and other Java EE Technologies and the fly likes JAXB - Ordering of elements in generated XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JAXB - Ordering of elements in generated XML" Watch "JAXB - Ordering of elements in generated XML" New topic
Author

JAXB - Ordering of elements in generated XML

Sahil Dave
Greenhorn

Joined: Nov 10, 2010
Posts: 11
Hello

I am using JAXB to marshall an object into XML. It looks like JAXB generates the XML with elements in alphabetical order.
Is there a way in which I can restrict the generated XML to have elements in the same order as the XSD?

Thanks


Sahil
Pallav Bora
Ranch Hand

Joined: Oct 13, 2009
Posts: 73
try using "sequence" element
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JAXB - Ordering of elements in generated XML