W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2007

Re: Attributes ordering

From: <noah_mendelsohn@us.ibm.com>
Date: Tue, 20 Mar 2007 17:42:38 -0400
To: Nataraj Ramalingam <Nataraj.Ramalingam@aricent.com>
Cc: "G. Ken Holman" <gkholman@CraneSoftwrights.com>, xmlschema-dev@w3.org
Message-ID: <OFD103B17C.8FD5EC1C-ON852572A4.0076AF6C-852572A4.0077437F@lotus.com>

Nataraj Ramalingam writes:

> So, this confirms that attributes can appear in any order in an 
> element instance. 

The short and simple answer is "yes".  For almost all practical purposes, 
the order of attributes is insignificant, as are some other details like 
whether you choose to use single or double quotes around attribute values.

Having given the simple answer, let me signal where exceptions can be 
found.  Some tools do work with XML at a lower level.  For example, some 
(not all) XML editors try to preserve the look of an XML document so that 
human readers can have an easy time.  So, for such tools, the order and 
even the layout of the attributes may be considered significant. 
Furthermore, XML is in the end text, and if you choose to use text tools 
on it, then things XML considers insignificant may matter.  A classic 
example is using source control systems to manage XML documents.  It's 
very typical to find arguments when XML projects start up about whether 
its OK for an XML editor to change attribute quotes from single to double, 
because many editors don't want to track what kind of quoting was used. 
>From an XML perspective, such changes are just fine, but it can lead CVS 
to conclude that 90% of your file has changed when in fact nothing 
important was touched.

Bottom line, attribute order mostly doesn't matter.


Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142

Nataraj Ramalingam <Nataraj.Ramalingam@aricent.com>
Sent by: xmlschema-dev-request@w3.org
03/19/2007 01:47 AM
        To:     "G. Ken Holman" <gkholman@CraneSoftwrights.com>
        cc:     xmlschema-dev@w3.org, (bcc: Noah Mendelsohn/Cambridge/IBM)
        Subject:        Re: Attributes ordering

Thanks Ken. 

So, this confirms that attributes can appear in any order in an element 

Kind Regards, 

xmlschema-dev-request@w3.org wrote on 03/19/2007 03:10:52 AM:

> At 2007-03-17 17:26 +0530, Nataraj Ramalingam wrote:
> >I am little new to XML. I have a basic doubt in the ordering of 
> >attributes inside a complex type.
> >...
> >I know that the elements ordering can be controlled using "sequence" 
> >or "all". But i am not sure about the same behavior with attributes.
> Note that XML 1.0 fourth edition (and all editions) states in section 
>    http://www.w3.org/TR/2006/REC-xml-20060816/#sec-starttags
>    Note that the order of attribute specifications in a start-tag
>    or empty-element tag is not significant.
> I hope this helps.
> . . . . . . . . . . . . Ken
> --
> World-wide corporate, govt. & user group XML, XSL and UBL training
> RSS feeds:     publicly-available developer resources and training
> G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
> Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/x/
> Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
> Male Cancer Awareness Aug'05  http://www.CraneSoftwrights.com/x/bc
> Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

***********************  Aricent-Private   *********************** 
"DISCLAIMER: This message is proprietary to Aricent and is intended solely 
for the use of 
the individual to whom it is addressed. It may contain privileged or 
confidential information and should not be 
circulated or used for any purpose other than for what it is intended. If 
you have received this message in error, 
please notify the originator immediately. If you are not the intended 
recipient, you are notified that you are strictly
prohibited from using, copying, altering, or disclosing the contents of 
this message. Aricent accepts no responsibility for 
loss or damage arising from the use of the information transmitted by this 
email including damage from virus."
Received on Tuesday, 20 March 2007 21:43:10 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:41 UTC