[uf-new] Pattern: Presence of Property

Scott Reynen scott at makedatamakesense.com
Tue Oct 9 06:45:40 PDT 2007


On Oct 9, 2007, at 6:43 AM, Ben Ward wrote:

> <span class="ingredient">3 Strawberries <span class="optional"> 
> (optional)</span></span>
>
> What would people think about this sort of parsing rule being added  
> to the microformats cannon?

I don't like how that reads.  The HTML spec says of the class  
attribute "the element may be said to belong to these classes" [1],  
but I don't think that's true in this case.  We would say "3  
Strawberries (optional)" belongs to the class of ingredient but we  
would not say "(optional)" belongs to the class of optional.  "3  
Strawberries" belongs to that class, which would give us this:

<span class="ingredient optional">3 Strawberries</span> (optional)

But that also gets into repeating ourselves.  Alternatively, I think  
it may be better to say that "(optional)" belongs to a class of  
dispensability, giving us this:

<span class="ingredient">3 Strawberries <span class="dispensability"> 
(optional)</span></span>

And maybe some parsers could assume any amount of dispensability  
makes something entirely optional, but others may choose to present  
the specific level of dispensability to users directly, as it may  
contain more specific information.

[1] http://www.w3.org/TR/html401/struct/global.html#h-7.5.2

--
Scott Reynen
MakeDataMakeSense.com


More information about the microformats-new mailing list