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

James Graham jg307 at cam.ac.uk
Wed Oct 12 08:52:20 PDT 2005


Mikko Rantalainen wrote:
> 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>
> ...

This is clearly useless for the reasons that everyone else has given. On
the other hand HTML /is/ lacking an elegant solution to the problem;
even if you introduce <ol type=""> or even number the list by hand you
still have to update the reference evrytime that a new item is added to
the list. The same applies to numbered sections, figures, etc. On the
other hand the majority of other tools (MS Word, LaTeX, (presumably)
most DTP programs, etc.) offer a convenient way to refer to a numbered
item elsewhere in the document. Syntatically this wouldn't be hard to
specify, something like:

<p>Quiz: Complete the sentence,"OpenDocument is ..."
<ol>
<li>An open, XML-based file format.</li>
<li>An open standard, supported by the OASIS and ISO standards groups.</li>
<li>The default file format for the upcoming OpenOffice.org 2.0 and
KOffice 1.4.</li>
<li>A top prospect for an official format for the European Commission.</li>
<li>Our best chance to fight vendor lock-in associated with proprietary
formats.</li>
<li id="#correct">All of the above.</li>
</p>

<p>The correct answer is <ref target="#correct" />) All of the above</p>

Rendering would be accoring to the CSS numbering scheme for the list
e.g. "The correct answer is f) All of the above"

However there are (at least) two difficulties:
Implementation might be hard. But probably no harder than CSS3 generated
content.

Getting a decent backwards compatibility story seems, uh, non-trivial at
the least. Of course this is true of CSS3 generated content as well but
that doesn't seem to bother people so much...

-- 
"It seems to be a constant throughout history: In every period, people
believed things that were just ridiculous, and believed them so strongly
that you would have gotten in terrible trouble for saying otherwise."

-- http://www.paulgraham.com/say.html




More information about the whatwg mailing list