You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Ivan Rubin Ayma <Ia...@mcsla.com.ar> on 2002/01/29 13:46:12 UTC

RE: why does xerces add attributes in alphabetical order of attribute name

Malia,

I've the same problem around here.

Please post the answer to the list if you find it...

Thanks,

-----Mensaje original-----
De: Malia Zaheer [mailto:mzaheer@technicacorp.com]
Enviado el: lunes, 28 de enero de 2002 15:46
Para: xerces-j-user@xml.apache.org
Asunto: why does xerces add attributes in alphabetical order of
attribute name


Hi,

I am trying to add 3 attributes to an element in this order:

       e.setAttribute("ref", "record");   
       e.setAttribute("minOccurs", "1");
       e.setAttribute("maxOccurs", "unbounded");
 

Later, when I try to serialize my dom tree, the attributes seem to be
added
in alphabetical order of the attribute name, like this:

     <element maxOccurs='unbounded' minOccurs='1' ref="record"/>

Why does xerces change the order of attributes?  Is there anyway to
force
order of attributes?

thanks for your help in advance,
Malia









---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: why does xerces add attributes in alphabetical order of attribute name

Posted by Eddie Robertsson <ed...@allette.com.au>.
> I've the same problem around here.
>
> Please post the answer to the list if you find it...

According to XML 1.0 all attributes are unordered. Hence, it is up to the
processor to return the attributes in any order it wants and there is no
way to force the order of the attributes. If you definately wants order
the make the attributes subelements instead.

Cheers,
/Eddie

> Thanks,
>
> -----Mensaje original-----
> De: Malia Zaheer [mailto:mzaheer@technicacorp.com]
> Enviado el: lunes, 28 de enero de 2002 15:46
> Para: xerces-j-user@xml.apache.org
> Asunto: why does xerces add attributes in alphabetical order of
> attribute name
>
> Hi,
>
> I am trying to add 3 attributes to an element in this order:
>
>        e.setAttribute("ref", "record");
>        e.setAttribute("minOccurs", "1");
>        e.setAttribute("maxOccurs", "unbounded");
>
>
> Later, when I try to serialize my dom tree, the attributes seem to be
> added
> in alphabetical order of the attribute name, like this:
>
>      <element maxOccurs='unbounded' minOccurs='1' ref="record"/>
>
> Why does xerces change the order of attributes?  Is there anyway to
> force
> order of attributes?
>
> thanks for your help in advance,
> Malia
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org