Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In XML, is the attribute order important? [duplicate]

Tags:

xml

attributes

I'm writing an application that produces a couple of XML files. In the files, some of the tags have attributes. I'd like to know if the order of the attributes is important, or it's the same.

For instance, this output:

<person first='john' last='doe'>

Is the same as this:

<person last="doe" first="john">
like image 878
Leoncio Sobrino Avatar asked Dec 10 '22 19:12

Leoncio Sobrino


1 Answers

According to the XML specification, it is not important.

the order of attribute specifications in a start-tag or empty-element tag is not significant

See section 3.1 in the specification available here: http://www.w3.org/TR/REC-xml/

like image 126
matli Avatar answered Jan 10 '23 08:01

matli