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

Re: Attribute Order (Was: Create XML )


xml attribute order
Andrew Watt wrote:
[[
In a message dated 22/06/2003 02:17:06 GMT Daylight Time,
simonstl@s... writes:


I don't mind given machines access to information in forms that are
easier for them - I just mind that information is lost in any round trip
through that giving of access and then back to XML.

Ditto for attribute order.


Thinking back to XML 1.0, why is it that attributes are not ordered?

It seems incongruous given that attributes are declared by an attribute list
declaration, implying ordering of attributes. I appreciate that Chapter 3 of
XML 1.0 (1st Edition) refers to a "set" of attribute specifications.
]]

If you want to preserve attribute order, as well as whether an attribute
value is single or double quoted, you need to use special software. Nothing
prevents you from doing so, for example Notepad :-), but nonetheless, when
the community coalesced around SAX, for example, the community decided that
the benefits of preserving attribute order did not justify implementation in
SAX. The XML Infoset was a post hoc specification that codified the behavior
of such APIs as SAX, as well as XPath etc.

So the reason that most XML software is not designed to preserve attribute
order is that the _intention_ of attributes was to serve as name-value
pairs, and to be easily implemented via a hashtable. When serialized,
hashtables are ordered, but the order is not intended to be significant,
ditto XML attributes.

Now there is nothing that _prevents_ your software from preserving attribute
order, but if you use such software you will loose the reuse of other
software written to preserve what is specified in the XML Infoset.

Jonathan


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.