[SML]My opinion - Leaving out attributes

Kent Sievers ksievers at novell.com
Tue Nov 30 19:06:26 GMT 1999


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 at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo at ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)





More information about the Xml-dev mailing list