- From: Mark Birbeck <mark.birbeck@x-port.net>
- Date: Sun, 22 Apr 2007 20:55:58 +0100
- To: RDFa <public-rdf-in-xhtml-tf@w3.org>
Jose, > From a theoretical standpoint your comments about the class attribute > make sense, but looking more into the reality nowdays, it is true the > fact that the class attribute is used by authors to convey presentation. > That is the reality, the state of the practice, regardless of what HTML > 4.01 says. I think there have been some pretty good responses to your post, but I thought it might help if I gave some links to discussions on this topic, that have taken place over the years. The main point is that there are a *lot* of blogs and articles out there that discuss how people should use @class 'semantically', and these blogs and articles are from well-respected authors or developers, who are very much in the real world. Back in 2002, Tantek argued that we should first use the most appropriate element (h1, h2, etc.) and then use @class to provide 'additional semantics': <http://tantek.com/log/2002/12.html#L20021216> He also discussed how we should not invent new things (like div/@class="heading") if there is a suitable HTML element available: <http://tantek.com/log/2004/07.html#reusexhtmlm12n> The following is a useful article on 'semantic mark-up' (see Google for plenty more): <http://www.shapeshed.com/journal/the_importance_of_semantic_markup/> This presentation on 'semantic HTML' is quite good for a number of issues that relate to RDFa and microformats, but of particular relevance to this discussion is slide 36: <http://www.ermanz.govt.nz/news-events/archives/presentations/semantichtml.html> Back in 2004, Jon Udell wrote the following on both semantic @class values, and the fact that @class can hold more than one value: <http://weblog.infoworld.com/udell/2004/02/09.html> Lots of people come at this issue from the microformats standpoint, but the rationale is exactly the same as we've used in RDFa. A recent example of someone coming at @class from the microformats viewpoint is Gregory Reimer from Sun, in an article entitled 'HTML class attributes aren't just for CSS' (there are plenty more like this, available via Google): <http://blogs.sun.com/greimer/entry/html_class_attributes_aren_t> I hope that helps explain why we believe that using the class attribute for semantics is already existing 'best practice', as well as demonstrating that this is not just something that we've plucked from the sky. The widespread use of @class 'semantically' also indicates to me that RDFa cannot simply invent a new attribute and ignore current practice; instead it must take on board current thinking, even if it has to also try to move it on. (Specifically, the need for namespace qualified values.) > <p class="myclassUseInCSS foaf:person"> > > why ? Because, two different people are going to be "touching" the same > attribute. The graphic designer who provides the final look and feel of > a page and the metadata provider who annotates a page. That's an issue. > Even, the designer will think that some styles are missing in the CSS > ... Summarizing, if an attribute can be multivalued, and that values > have not the same meaning, as it is the case, it can be a nightmare. But the designer should not really be adding CSS classes--in fact the modern approach is they shouldn't really be touching the page at all. The designer should be styling up already existing content and structure, provided to them by the programmers. This of course means that it is up to the programmers to ensure that there are plenty of 'hooks' for the designer to style by giving most items on the page a class, whether it's 'customer', 'delivery date', 'first name', etc. And it also means that the designer will have signficant input to the programmers to make sure that they get all the hooks they need. But the best approach is not for the programmer to pass a page to the designers, who then modify it and pass it on. > Also imagine that my page is generated by a server side script and that > for some reason the class attribute is generated dynamically, I have to > take care in generating also the "semantic values of the class > attribute", not only the presentation values. It's going to be a mess. But the point of the articles I've linked to above--and the hundreds more you'll find if you do a Google--is that there shouldn't be any values in @class that are playing the role of what you have called "presentation values". @class should contain _semantic_ values that are in turn used as 'hooks' for specifying presentational information. > New attributes are needed !!! Please...no. :) Regards, Mark -- Mark Birbeck, formsPlayer mark.birbeck@x-port.net | +44 (0) 20 7689 9232 http://www.formsPlayer.com | http://internet-apps.blogspot.com standards. innovation.
Received on Sunday, 22 April 2007 19:56:05 UTC