[whatwg] [WA1] <ol type=a> is semantic

Mikko Rantalainen mikko.rantalainen at peda.net
Wed Oct 12 02:26:22 PDT 2005


Simon Pieters wrote:
> Hi,
> 
> I think that <ol> should allow a type attribute as in HTML4[1].
> 
> An 1,2,3 list is different from an a,b,c list. If you want to discuss a 
> particular list item in the text then it doesn't make sense to say "f" when 
> the list says "6", for instance. Consider the following real world 
> example[2]:
> 
> | Quiz: Complete the sentence,"OpenDocument is ..."
> |
> | (a) An open, XML-based file format.
> | (b) An open standard, supported by the OASIS and ISO standards groups.
> | (c)The default file format for the upcoming OpenOffice.org 2.0 and KOffice 
> 1.4.
> | (d) A top prospect for an official format for the European Commission.
> | (e) Our best chance to fight vendor lock-in associated with proprietary 
> formats.
> | (f) All of the above.
> |
> | The correct answer is (f) All of the above.

I think the reason for not including "type" attribute in HTML is 
that one shouldn't ever refer to anything by textual label only - 
we're using HyperText Markup Language so the only way to refer to 
something should be in form of hyperlink.

The above example should have markup such as

...
<li id="quizanswer">All of the above</li>
</ol>
<p><a href="#quizanswer">Correct answer is ...</a></p>
...

and the UA should take care of the rest. Activating the link should 
highlight (or indicate in some other way) the correct answer because 
it's the target of the activated hyperlink.

As long as the (X)HTML WG believes that this is how the world should 
work, there's no way we can get the fix in the HTML specification.

This problem has been discussed many times before and there're cases 
where one needs more complicated item markers than 1,2,3 or a,b,c. 
An example could be "§1, §2a, §2b, §3, ...". Such thing would still 
be an ordered list but there isn't a good way to mark up such a 
content to have semantics of a list. We would need a <ol> (ordered 
list), <li> (list item) and <lim> (list item marker) and then we 
could do something like this:

<ol>
<li><lim>§1</lim> first item</li>
...
</ol>
...
... as defined in §1, we can ...

It would be up to UA, where the contents of <lim> element should be 
rendered. It could be rendered to the "normal bullet point position" 
or CSS could be used to give a hint about the author's recommended 
position.

-- 
Mikko



More information about the whatwg mailing list