This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: JAXB - Ordering of elements in generated XML
 
It's not a secret anymore!