Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting the order of attributes for XML in XSD (XML Schema)

Tags:

xml

xsd

Is there any way to set the order of attributes in XML from Schema?

like image 642
Swati Avatar asked Aug 31 '25 20:08

Swati


2 Answers

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.

like image 161
kjhughes Avatar answered Sep 03 '25 20:09

kjhughes


I think it is not possible by means of XML Schema because according specification of XML the order of attributes is not significant.

like image 34
Jirka Š. Avatar answered Sep 03 '25 20:09

Jirka Š.