- From: Daniel Glazman <glazman@netscape.com>
- Date: Wed, 12 Mar 2003 10:45:21 +0100
- To: "www-html@w3.org" <www-html@w3.org>
Ian Hickson wrote: >>An attribute is not content. > > > This is fundamentally untrue. > > An attribute is just syntactic sugar for an unordered child element > containing only a text node. Oh, come on... (I know we already had this discussion many times together but not in this mailing-list). An attribute is a decoration on the tree and not real content. There are several arguments known since the release of SGML, and the DOM as it is today is another good bit of an argument. 1. it is possible to traverse a document's tree using the DOM without having to traverse all attributes. That's the point of parentNode, firstChild, lastChild, nextSibling and previousSibling. 2. the DOM is not attribute-oriented. To look for all elements carrying a given attribute, you have to traverse the elements' tree and then check for attribute presence for every element. 3. it is perfectly possible with a super-minimal amount of code, in the language of your choice, to strip all attributes keeping the content of the document. 4. unless you work in a source environment, and unless you can use a style language having attribute selectors, attributes are not meant to be presented to the reader and have no influence on the rendering. 5. I don't disagree with the fact that some DTDd explicitely put content in attributes. That's bad design. That does not imply that attributes **are** content. Cf. "Developing SGML DTDs from Text to Model to Markup", by Eve Maler and Jeanne El Andaloussi. A must-have. 6. attributes usually imply no toplevel semantic change. A list is a list. A list with a start attribute remains a list. Even if you change the current list model to add an ordered="yes|no" attribute, that's still a list. The content is NOT changed. It's more or less decorated, that's all. </Daniel>
Received on Wednesday, 12 March 2003 04:45:22 UTC