does the order of the attributes in the root element matter?

H

hilz

Hi.
I have two xml files with the following roots:

<MyRootElement
xmlns="http://myURI"
xmlns:prefixA="http://URI_for_A"
xmlns:prefixB="http://URI_for_B"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://myURI http://myURI/mySchema.xsd"
prefixA:someAttribute="some value"
in another file, i have this:

<MyRootElement
xsi:schemaLocation="http://myURI http://myURI/mySchema.xsd"
prefixA:someAttribute="some value"
xmlns="http://myURI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:prefixA="http://URI_for_A"
xmlns:prefixB="http://URI_for_B"

I know the first one is the correct one.
But my question is: is the second one wrong? does the order of the
attributes in the root element really matter?

Thanks
 
R

Richard Tobin

But my question is: is the second one wrong? does the order of the
attributes in the root element really matter?

No, the order of attributes is never important in XML.

-- Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top