File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply 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 agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: JAXB - Ordering of elements in generated XML
 
Similar Threads
Change the order of elements in JAXB
Handling of elements inside choice by JAXB
JAXB XPATH API
XML to XML using XSLT or other solution
Identifying elements inside choice by JAXB