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

Re: Order of attributes

attribute reorder xml
In article <abd24ff9f23d1848108f9d0a94cb3a6f@r...> you write:

>I'm probably being thick.. but I don't understand this. That's probably 
>because I think *semantics* are entirely in the eye of the beholder.

If they were *entirely* in the eye of the beholder, then XML wouldn't
help interoperability at all.  For example, as I suggested before, you
could encode all your information in the spacing between attributes,
but then what good would it be to use XML?  No other XML tool would
understand it.

Long ago ASCII, and later Unicode, saved us from having how to decide
how to encode characters for each application.  Apart from saving us
the effort of choosing, this had an obvious advantage: we could write
all kinds of tool that were useful for many different file formats.
We could edit Fortran programs and invoices with the same editor.  We
could grep for strings or count lines in any kind of text file.

XML does the same at the next level up: it saves us from choosing
a format for simple nested structures and named attributes.  And
it lets us build generic tools that can do useful things with all
kinds of XML document - consider XSLT for example.

We have gained that at the expense of removing some semantics from the
eye of the beholder.  We accept start and end tags as meaning some
kind of nesting.  We accept attributes as things that are identified
by name, not position.  And we accept white space inside tags as just
being for formatting and readability.

A binary file could be considered to conform to the "grammar" of ISO
Latin-1, because it consists of a sequence of 8-bit bytes.  But it
isn't Latin-1, because the bytes aren't interpreted in the way that
Latin-1 specifies.  Likewise a file that looks like XML but assigns
significance to attribute order may conform to the grammar of XML, but
it isn't XML.

And this is a good thing, because imposing such (minimal) semantics
allows us to write a range of generic XML tools.

>It seems to be that *some* editors might understand *all* of the 
>semantics of XML (as I believe you mean it), but augment them with 
>constraints/semantics above and beyond those?

Yes, an XML editor could do that.  But when it preserved the order of
attributes, it would be operating merely on the syntax.

-- Richard


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.