[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Order of attributes


xml attributes order
Was: Re:  Principles of XML design
[see also Karl Waclawek's simultaneous posting]

On Fri, 6 May 2005, Richard Tobin wrote:

> In article <0f38e342973d0996f72284409ab2176b@r...> you write:
> >I think that if anything, all discussion of processing, including
> >attribute order, should be removed from the spec. XML is a syntax, and
> >what applications do with it is entirely up to them.
>
> I disagree.  To invent a document format in which the order of
> attributes is significant and then claim that it conforms to XML would
> be misleading to say the least, since it would not be interoperable with
> the majority of XML tools (which don't preserve attribute order).

The question was probably in a different plane: not inventing a new
format, but judging whether XML spec was true to its principle of
separating the responsibilities of a parser and an application when it
made attributes unordered.  Attributes, as elements, _are_ ordered in the
document, so wouldn't it be more appropriate to require a parser to report
them in order and let the application to impose an unordered semantics, if
it wishes?  This would be similar to elements and the Schema's
"interleave" operator that manifests "don't care" attitude of some
applications to the order of elements.

More practically, if a parser guarantees reporting attributes to the
application in their order of occurrence in a document, would this be a
reason to declare the parser incompliant with XML 1.0?  Is there a
scenario where such a parser can create interoperability problems with
existing XML tools? (There are, of course, problems for applications that
use an order-preserving parser: they cannot reliably rely on order if
they consume XML from applications that are incapable of ensuring an
attribute order.)

Btw. the Rec (Section 3.1) says that "order of attribute specifications in
a start-tag or empty-element tag is not significant", without apparently
explaining what "being significant" means.  Moreover, this phrase appears
starting from 2nd edition only!

Vladimir

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.