users@jaxb.java.net

Re: Sorting the arguements

From: Hello! hello <prosp4300_at_gmail.com>
Date: Sat, 20 Nov 2010 01:29:36 +0800

Order of attributes is controlled by schema file, if you use java-to-schema
mapping, this can be customized easily by
@XmlType(propOrder={"action", "companyId", "companyName", "descData"})
public class AchCompany {}

2010/11/18 Aleksei Valikov <valikov_at_gmx.net>

> Hi,
>
> > How to arrange the attributes in the element tag of the XML file? I am
> using
> > the jaxb APIs
> >
> > <achCompany action="A" descData="9999DescData"
> companyName="9999ComName"
> > companyId="9999ComId">
> >
> > <account action="A" abaNumber="21000021" number="0
> > 99999999999999999999999" />
> >
> > </achCompany>
> >
> >
> >
> > It should look something this.
> >
> > <achCompany action="A" companyId="91" companyName="ACHPay_91"
> descData="ACH
> > Co Desc 91">
> >
> > <account number="00000000000000617127733" abaNumber="044000037"
> action="A"
> > />
> >
> > </achCompany>
>
> Order of attributes is not significant in XML. And you can't controll
> it over JAXB.
>
> Bye,
> /lexi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>