Hello,

Sorry i frogot to mension this problem is affect when I use converter.
When unmarshall method calling i try to get the attributes and i got this
in bad order.
I use XppDomDriver because the default XppDriver doesn't work well with
attributes (or i made something's wrong).
Sorry for my bad english.



*for(int i = 0; i < reader.getAttributeCount(); i++){
element.getAttributes().add(new Attribute(reader.getAttributeName(i),
reader.getAttribute(i)));}*

Thanks for your help!



2014/1/21 Jörg Schaible <joerg.schai...@gmx.de>

> Hi Márk,
>
> Márk Pásztor wrote:
>
> > Hello everybody,
> >
> > I use xstream for a year. It's work very well.
> > But now I got a problem. I would like to write an xml file from an input
> > xml file.
> > And I would like to preserve the order of input attributes to the output
> > file.
> >
> > Now looks like this:
> >
> >
> >
> > *INPUT:<test a="w" b="I" c="553.0" d="1.0"/>OUTPUT:<test b="I" a="w"
> > d="1.0" c="553.0"/>*
> >
> > Expected result:
> >
> >
> >
> > *INPUT:<test a="w" b="I" c="553.0" d="1.0"/>OUTPUT:<test a="w" b="I"
> > c="553.0" d="1.0"/>*
> >
> > What can I do in this case? Do you have any ideas?
>
> XStream writes attributes normally in declaration order of the Java type.
>
> Cheers,
> Jörg
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>


-- 
Üdvözlettel,
Pásztor Márk

Reply via email to