users@jaxb.java.net

Re: Subject: Ordering of enum values/xsd attributes in XJC

From: Kenny MacLeod <kennym_at_kizoom.com>
Date: Mon, 14 Aug 2006 18:07:12 +0100

it was marked as fixed in 2.0.2, but I haven't taken the opportunity to
verify it yet.


jason white wrote:
> Can someone please tell me if this was addressed?
>
>
>
>
>
> --If I have a schame with the following type:
>
> -- <simpleType name="TestEnum">
> -- <restriction base="NMTOKEN">
> -- <enumeration value="b"/>
> -- <enumeration value="a"/>
> -- <enumeration value="c"/>
> -- </restriction>
> -- </simpleType>
>
> --The when XJC turns this into a java enum type, then it will re-arrange
> --the enumeration values into alphabetical order:
>
> --_at_XmlEnum
> --public enum TestEnum {
>
> -- @XmlEnumValue("a")
> -- A("a"),
> -- @XmlEnumValue("b")
> -- B("b"),
> -- @XmlEnumValue("c")
> -- C("c");
> --}
>
> --While I appreciate that the permitted enum values in the XML Schema are
> --not strictly speaking ordered, the values in a java enum type are.
>
> --Is there any reason why XJC couldn't retain the ordering of enum values
> --in the generated java? Information is being lost during the translation.
>
> --Should I file an issue for this?
>
>
> --kenny
>
> I am looking at a similar problem where I have an xsd that lays out
> attributes in an order similar to:
>
> - A
> - C
> - B
>
> and xjc generates object with attributes in the order of (which is not
> desired):
>
> -A
> -B
> -C
>
> -jason
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>