[uf-dev] Using class for non-human data

Scott Reynen scott at randomchaos.com
Tue Jun 24 05:37:59 PDT 2008


On [Jun 24], at [ Jun 24] 5:52 , André Luís wrote:

> <abbr class="dtstart data{2008-06-23}" title=June 23rd, 2008">Today</ 
> abbr>
>
> 1. grab elementByClassName( dtstart )
> 2. get classnames as array
> 3. grab classname after dtstart(ie, i+1, i being the index of
> dtstart), does it match /data{[^}]*}/ ?
> 4. if yes, use it as value.
>
> What's so wrong with this approach?


I'd say there's nothing "so" wrong about it, but there are problems.   
Specifically, "data{2008-06-23}" doesn't seem to be an actual  
classification of "Today."  It doesn't make much sense to say "Today  
belongs to the class data{2008-06-23}."  But the HTML spec says " the  
element may be said to belong to these classes."  Unfortunately we may  
not see the practical implications of such a seemingly insignificant  
deviation from the spec until after a decision is made, as happened  
with the abbr pattern.  Another seemingly small issue: this solution  
binds us to machine-readable data formats that have no spaces.  These  
may not be reasons to discard this solution, but I hope they're at  
least reasons to more thoroughly research potential problems so we  
don't make the same type of mistake again.

Peace,
Scott




More information about the microformats-dev mailing list