Is there any way to set the order of attributes in XML from Schema?
Asked
Active
Viewed 2,251 times
2 Answers
6
Attribute order is insignificant per the XML Recommendation:
Note that the order of attribute specifications in a start-tag or empty-element tag is not significant.
Therefore, XML Schema provides no way to constrain attribute ordering.
In general, the XML recommendations will all consider attribute ordering to be insignificant, but see the section on attribute processing in the XML Normalization Recommendation or the Canonical XML Recommendation if your application has a need for attribute ordering.

kjhughes
- 106,133
- 27
- 181
- 240
-
2If you are building a tool that is dependant on the order of an XML elements atttributes you are ***Doing it wrong™*** – Oct 17 '13 at 04:45
3
I think it is not possible by means of XML Schema because according specification of XML the order of attributes is not significant.

Jirka Š.
- 3,388
- 2
- 15
- 17