Lists Home |
Date Index |
The fact that attribute order is not considered meaningful allows you to
do things that you couldn't if order were meaningful, as does the fact
that attributes must have unique names.
Taken together it makes it so you can think of the set of attribute
name/value pairs as a hash rather than an array.
- the attribute name serves as a hook with which you can unequivocally
retrieve a single piece of information
- the name is ALL you need to retrieve the information, no need to be
informed about other members of the attribute collection
There are all kinds of other differences between unordered lists where
values are retrieved using keys and ordered list where they are
retrieved by index.
I can't second guess the designers of SGML, but it's convenient to have
both the attribute set which can be looked at as a simple hash and a
element set which is kind of a mixed up nested array/hash thingy.
And of course now so much has been built around the fact that it is this
way that there are a million "reasons on the ground"
CDC Site Dev->Interface Development Team
> -----Original Message-----
> From: Jim Melton [mailto:email@example.com]
> Sent: Friday, January 06, 2006 12:42 PM
> To: Bullard, Claude L (Len)
> Cc: 'firstname.lastname@example.org'; DuCharme, Bob (LNG-CHO); Xasima
> Xirohata; email@example.com
> Subject: RE: [xml-dev] The order of attributes
> One thing that I've heard from some of the designers of XML
> (and of SGML,
> for that matter) is that attributes were intended to
> represent "metadata"
> and elements to represent "data". Of course, distinguishing
> between those
> is fuzzy at best and certainly subjective. But things like
> "this data was
> generated on this date" or "this document was authored by
> this person" were
> considered to be appropriate for metadata/attributes, while
> "this data" or
> "this document" were considered to be appropriate for data/elements.
> Under the assumption that what I have heard is correct, then
> I think that
> explains the reason that the order of attributes was not considered
> important. Certainly, it makes just as much sense to say
> "Joe wrote this
> book in 1997" as it does to say that "In 1997, Joe wrote this
> book". Thus
> <book author="Joe" date="1997"><chapter>...</chapter></book>
> is identical
> to (in meaning) <book date="1997"
> I might dare say that the "reason" why attribute order is explicitly
> irrelevant is because SGML was designed for documents much
> more than for
> data, and XML inherited the same view of its use. They were
> both designed
> by "doc-heads", not by "data-heads" who have a much different
> view of the
> Hope this helps,
> At 1/6/2006 01:25 PM, Bullard, Claude L (Len) wrote:
> >My guess is (and I wasn't there) is that it added
> >complexity and duplicated features in the tree. SGML
> >is complicated enough without adding yet another
> >feature that isn't useful in a large number of cases.
> >However, turning this on the head a bit, if XML
> >was to be a simplified SGML, why would we have added
> >features that are not very useful in a large number
> >of cases?
> >Keep in mind, SGML had to be modified
> >slightly to make XML a proper subset so it is
> >conceivable that something along this line could
> >have been added. Again was it 'very useful in a large
> >number of cases' where those cases did not include
> >all of the things to which XML has been applied
> >in the aftermath that the right people considered
> >important then.
> >Only a few wild and crazy people thought XML would
> >become the lingua franca for all bits on the wire.
> >From: firstname.lastname@example.org [mailto:email@example.com]
> >Quoting "DuCharme, Bob (LNG-CHO)" <firstname.lastname@example.org>:
> > > I think the general idea is that if the ordering of pieces of
> > > information associated with an element matter to an
> application, then
> > > they should be declared in the content model as child
> elements, where
> > > you have various regular-expression-like options for
> describing ordering
> > > options.
> >I agree with this interpretation, but it does not explain
> _why_ attribute
> >is explicitly not relevant.
> >The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> >initiative of OASIS <http://www.oasis-open.org>
> >The list archives are at http://lists.xml.org/archives/xml-dev/
> >To subscribe or unsubscribe from this list use the subscription
> >manager: <http://www.oasis-open.org/mlmanage/index.php>
> Jim Melton --- Editor of ISO/IEC 9075-* (SQL) Phone:
> Co-Chair, W3C XML Query WG; F&O (etc.) editor Fax :
> Oracle Corporation Oracle Email: jim dot melton at
> oracle dot com
> 1930 Viscounti Drive Standards email: jim dot melton at
> acm dot org
> Sandy, UT 84093-1063 USA Personal email: jim at
> melton dot name
> = Facts are facts. But any opinions expressed are the
> opinions =
> = only of myself and may or may not reflect the opinions of
> anybody =
> = else with whom I may or may not have discussed the issues
> at hand. =
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> The list archives are at http://lists.xml.org/archives/xml-dev/
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>