Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to custom the order of the attributes when using JAXB?

hansenfanOct 21 2009 — edited Jun 27 2011
Hi All,

I have a XML file segement:
<Person age=20 level="High" name="fan">
<Attribute>
<Attribute/>
</Person>

I create the scheme file for the xml file and use JAXB parsing the XML file, and update the file(add a new filed, nickName="hansen").
I hope the output file is:
<Person name="fan" nickName="hansen" age=20 level="High" >
<Attribute>
<Attribute/>
</Person>

From the two segments, the name fileds is in front.
So how to custom the order of the fileds when using JAXB?

Thanks in advance!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 25 2011
Added on Oct 21 2009
4 comments
12,431 views