users@jaxb.java.net

Re: influencing the ordering of attributes for marshalling

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 27 Jun 2003 08:08:49 -0700

Peter Meulmeester <pmeulmeester_at_catlogic.com> wrote:
> Thanks, that is what I thought. The attributes would be saved in a hash. :-(
> Is it possible to get a hook into the marshalling process and specify a
> sorting algorithm, at leat alfabetically?

You could specify your own ContentHandler that writes to XML. Search the
archive for keywords like "XMLWriter" and you'll see a lot more.

By using this mechanism, you could intercept SAX events, sort the
attributes. and pass those to the real writer.

regards,
--
Kohsuke Kawaguchi                  408-276-7063 (x17063)
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com