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

Re: Principles of XML design

xml x26
Gavin Thomas Nicol wrote:
>> 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).
> In think you cannot see the API for the syntax.

XML *is* the syntax. The API is something else - DOM, for instance.

> I have, in fact, had the requirement for maintaining attribute order 
> in XML laid upon me more than once by people writing things like 
> editors, or people interacting with an XML database. Preserving 
> whitespace is almost a religious issue for many people, and falls into 
> the same class of problem. People have got *quite* upset when the 
> documents get "munged", even though the documents would parse exactly 
> the same way using SAX.

If people want to preserve the original stream of bytes, they can do so 
by preserving the original stream of bytes. No XML processor is 
required to report things like whitespace in tags, whitespace in the 
prolog or following the root element closing tag, the UTF-16 byte order 
mark, whether attributes are delimited by apostrophes or quotes, 
whether ampersands are encoded as & or & or &. All of 
these issues have been discussed to death in XML Canonicalization.

> The point here is that a *syntax* defines nothing more than the 
> grammar of a data format... the structure of a stream of bits. The 
> *processor/parser* of that stream of bits defines what is significant 
> or not. That the vast majority of XML tools works one way vs. another 
> is largely due to a shared understanding of processing model in the 
> community (which should be documented), not the grammar of XML.

Not at all. The spec says the order of attributes is not significant. 
Whether one processor or another chooses to believe that it is 
significant is irrelevant. Building an expectation of such behaviour 
will simply leave your users confused and unhappy when they start using 
another, conformant XML processor without that behaviour and their 
application is broken.
Chris Burdess


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.
First Name
Last Name
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.