users@jaxb.java.net

Re: Re: attribute order

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Fri, 24 Apr 2009 07:13:40 +0200

Hi.

> True, attribute ordering isn't significant in XML.  But it would be nice
> if JAXB matches the order in which they are read from the XSD.  Makes
> readability and comparison between the XSD and XML easier.  Or, at least
> output in ascending alphabetical order.

JAXB does dot implement any XML serialization, it's the task of
underlying DOM/SAX implementation. JAXB simply can't influence the
order of atributes in the serialized XML.

If the order of attributes is for some reason significant for you, you
have to tweak it on the XML level. Like, using parser or serializer
which supports this feature. Check if Xerces has this feature.

Bye.
/lexi