users@jaxb.java.net

Re: preserve the element order in schema...

From: <Jagdeep_Singh_at_capgroup.com>
Date: Wed, 16 Mar 2005 09:36:36 -0800

Kohsuke,

Thanks for the reply. yeah thats right .... I am reading the docment &
writing it back and order is preserved. But what I need is that the order
should be preserved in soure code to declare members in the order they
appear in a schema.

Now the reason is...I am working on tool to generate form (page showing
certains fields for user input) using underline schema. I am relying on
JAXB to preserve the order so that form will show the fields in ther order
it was declared in schema. This will make tool configurable in the sense
that you can maintain your order of entry fields.

- Thanks
Jagdeep Singh (CONJPS)
BRO-100-1 x55574
Email: conjps_at_capgroup.com


                                                                           
             Kohsuke Kawaguchi
             <Kohsuke.Kawaguch
             i_at_Sun.COM> To
                                       users_at_jaxb.dev.java.net
             03/16/2005 09:08 cc
             AM
                                                                   Subject
                                       Re: preserve the element order in
             Please respond to schema...
             users_at_jaxb.dev.ja
                  va.net
                                                                           
                                                                           
                                                                           
                                                                           




Jagdeep_Singh_at_capgroup.com wrote:
> Hi All,
>
> How to preserve the elements order in schema in generated JAXB impl
class.?
> I am using JAXB 1.0.2.

If you read a document and write it back, orders of sibling elements are
  preserved.

> I want to have the class members in generated jaxb class in the same
order
> as I defined in underlying schema.

There's no "order" among class members, so I'm not sure what you mean.
Do you want the source code to declare members in the order they appear?
If so, why?


--
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com