[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Order of attributes
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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|