File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
EJB and other Java EE Technologies
JAXB - Ordering of elements in generated XML
Joined: Nov 10, 2010
Apr 06, 2011 09:43:38
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?
Joined: Oct 13, 2009
Apr 08, 2011 14:04:16
try using "sequence" element
It is sorta covered in the
JavaRanch Style Guide
subject: JAXB - Ordering of elements in generated XML
XML to XML using XSLT or other solution
JAXB XPATH API
Handling of elements inside choice by JAXB
Change the order of elements in JAXB
Identifying elements inside choice by JAXB
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014