users@jaxb.java.net

RE: Re: attribute order

From: Vinh Nguyen (vinguye2) <"Vinh>
Date: Thu, 23 Apr 2009 14:52:18 -0700

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.
-Vinh


-----Original Message-----
From: aleksei.valikov_at_gmail.com [mailto:aleksei.valikov_at_gmail.com] On
Behalf Of Aleksei Valikov
Sent: Thursday, April 23, 2009 6:37 AM
To: users_at_jaxb.dev.java.net
Subject: Re: attribute order

Hi,

> Is there a way to get JAXB to print attributes in the order they are
> defined in the XSD? Currently, they are printed in reverse.
>
> For example, this is my schema:
> <xs:complexType name="EventType">
> <xs:attribute name="id" type="xs:string" use="required"/>
> <xs:attribute name="trigger" type="xs:string" use="required"/>
> <xs:attribute name="handler" type="xs:string" use="required"/>
> </xs:complexType>
> This is the XML output:
> <event handler="showHelpPage()" trigger="onclick()"
> id="OnClickEvent"/>

No. Order of attributes is not significant in XML.

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