I would like know if there is an order defined in which attributes and namespace definitions can occur in an xml tag element. Let’s assume the following element:
<tag attr1="a1" attr2="a2" xmlns="ThisIsTheNameSpace">value</tag>
So the question is: Must be the xmlns after the attributes or before them or doesn’t it matter.
<tag xmlns="ThisIsTheNameSpace" attr1="a1" attr2="a2">value</tag>
or could it be anywhere like this:
<tag attr1="a1" xmlns="ThisIsTheNameSpace" attr2="a2">value</tag>
Are there any kind of definitions?
According to section 3.1 of the Extensible Markup Language (XML) 1.0 (Fifth Edition), no, the order does not matter.
http://www.w3.org/TR/REC-xml/#sec-starttags