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

[SML]My opinion - Leaving out attributes

  • From: "Kent Sievers" <ksievers@n...>
  • To: <xml-dev@i...>
  • Date: Tue, 30 Nov 1999 12:03:44 -0700

list in sml
I think that SML should choose to not use attributes.

My initial reaction to the existence of both attributes and elements was that they were redundant: two ways of representing the same thing.  For example, using them to distinguish data from meta data, simply because they both exist, is arbitrary.  Data vs. meta-data could have been represented using elements only.

But they are not identical.   There are differences between the two.  Attributes can not contain sub-attributes, can not occur more than once, and their order does not matter, for example.  People are laying out languages based on these differences.  Their choices are often arbitrary.  My favorite to date went something like this:
we chose to put our data into attributes, (e.g. <Author  FirstName="Joe"/> instead of <Author><FirstName>Joe</FirstName></Author> because we didn't want repeating properties and this way the parser takes care of them for us.

Each subsequent recommendation has magnified the arbitrary choices.  I have seen people, for example, choose attributes over elements because it takes fewer DOM calls to work with them.  DOM and DTDs seem to lean people toward attrbiutes over elements for reasons that seem equally arbitrary to me.

When the Namespaces recommendation came along, I saw people choosing elements over attributes simply because attributes "did not inherit namespaces properly".

XSL (at least the MicroSoft stuff I have dealt with) has holes in the feature set when dealing with elements that make attributes a better choice.

The current query and pointer stuff, if I understand them, makes elements easier to deal with than attributes.

I can't image the pains that the schema group must be going through trying to deal with both and their differences.

Now, having said all of that, I have to admit that there are two attributes that  I currently do use when I am in charge of the language being designed: xmlns and dt.

Finally, how can people like me (who are forced to consume everyone elses languages) deal with people who choose (being completely within their XML rights) to represent something like:
<property tag="First Name" value = "Joe"/> for aribitrary reason like (this one is my all time favorite) "this way we can have spaces and colons in our tag names." 

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@i... the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


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.