|
Posted by Lars Eighner on September 13, 2007, 1:17 pm
Please log in for more thread options
I take this example from a writer in alt.usage.english
of whether the "and" is required came up strictly as an issue of English
usage, because it illustrates a recurring problem in HTML markup.
> Bob went to the store for the following reasons:
> (1) He had to get groceries for his mother;
> (2) He wanted to get out of the house;
> (3) He liked a girl who worked at the supermarket; and (?)
> (4) He needed cigarettes.
How should this be marked up? Yes, generally, "Bob went to the store..."
is marked up in P and the items as LI in OL. But logically, the list
belongs to the paragraph. (There is also the issue of the "and" which
logically does not belong to any list item, but to the logical paragraph
beginning with "Bob went....")
In HTML, the P element does not allow any block element. The list elements
(UL, OL, and DL) have no element suitable for identifying what the list is a
list of and parts like the "and" must be contained in one of the allowed
list elements (LI, DT, DD). In other words, it is impossible to markup the
above example in a satisfactory way.
<p>Bob went to the store for the following reasons: <br>
(1) He had to get groceries for his mother; <br>
(2) He wanted to get out of the house; <br>
(3) He liked a girl who worked at the supermarket; and <br>
(4) He needed cigarettes.</p>
is of course valid, but BR is presentational and that there really is a list
here is lost.
<ol>Bob went to the store for the following reasons:
<li>He had to get groceries for his mother;</li>
<li>He wanted to get out of the house;</li>
<li>He liked a girl who worked at the supermarket;</li> and
<li>He needed cigarettes.</li></ol>
is invalid because "Bob went ..." and "and" are not contained in any list
element.
The usual way we handle this situation,
<p>Bob went to the store for the following reasons:</p>
<ol>
<li>He had to get groceries for his mother;</li>
<li>He wanted to get out of the house;</li>
<li>He liked a girl who worked at the supermarket; and</li>
<li>He needed cigarettes.</li>
</ol>
is valid but not logical because "Bob went ... reasons:" is not logically
a paragraph and "and" does not logically belong to any item. (And of course
there is the purely presentational bother of styling to leave out the
extra line spacing.)
Notice that within a list, it is possible to identify (describe or whatever)
sublists:
<ol>
<li>He had to get groceries for his mother including
<ol>
<li>eggs,</li>
<li>two bottles of Wild Irish Rose,</li>
<li>dog food, and</li>
<li>a dozen condoms;</li>
</ol>
</li>
<li>He wanted to get out of the house;</li>
<li>He liked a girl who worked at the supermarket; and</li>
<li>He needed cigarettes.</li>
</ol>
but there is no element for describing the top-level list.
It seems to me the principal flaw here is that P is not really logical in
HTML. While the absences of a descriptive element from the lists and the
problem of what to do with punctuation and connective matter which do not
really belong to the items is somewhat annoying, the major problem is
that P does not admit any block elements. A similar problem appears with
BLOCKQUOTE. There is not really a logical difference between a short
quotation used in a paragraph and a long one. The difference is purely
presentational. When a quotation is used as evidence (as opposed to
dialogue), there is no reason in principle that the decision of whether to
display it inline or as a blockquote could not be left up to the user agent,
according to how long it is in relation to the current display (for example,
a common rule is to use a blockquote-like presentation when the material is
longer than two lines --- and only the user-agent knows what two lines is or
even if there is such a thing as a line of some length).
P would be more logical if it admitted some block elements.
--
Lars Eighner <http://larseighner.com/> <http://myspace.com/larseighner> Countdown: 494 days to go.
What do you do when you're debranded?
|
|
Posted by Stefan Ram on September 13, 2007, 3:22 pm
Please log in for more thread options
>Bob went to the store for the following reasons:
>(1) He had to get groceries for his mother;
>(2) He wanted to get out of the house;
>(3) He liked a girl who worked at the supermarket; and (?)
>(4) He needed cigarettes.
NB: In Usenet, ">" at the start of a line, usually indicates a
quotation from the posting at the end of the References-header.
A quotation from the W3C Recommendation »HTML 4.01 Specification«:
<DL>
<DT><STRONG>Lower cost</STRONG>
<DD>The new version of this product costs significantly less than the
previous one!
To show, that the dt element does not need
to be a defined term in the strictest sense.
Thus,
<dl>
<dt>Bob went to the store for the following reasons:</dt>
<dd>
<ol>
<li>He had to get groceries for his mother;</li>
<li>He wanted to get out of the house;</li>
<li>He liked a girl who worked at the supermarket; and</li>
<li>He needed cigarettes.</li></ol></dd></dl>
(The »;« and »; and« could be removed
for CSS-Browsers and implemented via CSS.)
|
|
Posted by Harlan Messinger on September 13, 2007, 3:50 pm
Please log in for more thread options
Stefan Ram wrote:
>> Bob went to the store for the following reasons:
>> (1) He had to get groceries for his mother;
>> (2) He wanted to get out of the house;
>> (3) He liked a girl who worked at the supermarket; and (?)
>> (4) He needed cigarettes.
>
> NB: In Usenet, ">" at the start of a line, usually indicates a
> quotation from the posting at the end of the References-header.
>
> A quotation from the W3C Recommendation »HTML 4.01 Specification«:
>
> <DL>
> <DT><STRONG>Lower cost</STRONG>
> <DD>The new version of this product costs significantly less than the
> previous one!
>
> To show, that the dt element does not need
> to be a defined term in the strictest sense.
>
> Thus,
>
> <dl>
> <dt>Bob went to the store for the following reasons:</dt>
> <dd>
> <ol>
> <li>He had to get groceries for his mother;</li>
> <li>He wanted to get out of the house;</li>
> <li>He liked a girl who worked at the supermarket; and</li>
> <li>He needed cigarettes.</li></ol></dd></dl>
Assuming a list is understand to be a thing with more than one item,
this would be semantically improper on the grounds that this DL only
contains one term/definition item.
|
|
Posted by Jukka K. Korpela on September 13, 2007, 4:02 pm
Please log in for more thread options
Scripsit Stefan Ram:
> A quotation from the W3C Recommendation »HTML 4.01 Specification«:
You're quoting a bad example, not a normative definition.
> To show, that the dt element does not need
> to be a defined term in the strictest sense.
No, it's just an example that violates the semantics expressed in the
normative prose.
This has been discussed dozens of times in this group. And as usual, the
proposed abuse of <dl> wins absolutely nothing. You get a semantic
connection, but a wrong one, and with no useful implications. You get some
rendering, but other approaches actually give more easily styleable
constructs.
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
|
|
Posted by Stefan Ram on September 13, 2007, 4:34 pm
Please log in for more thread options
>>A quotation from the W3C Recommendation »HTML 4.01 Specification«:
>You're quoting a bad example, not a normative definition.
Section 10.1 »Introduction to lists« does not have a formally
separated example section.
OK, it is being written »examples are for information only«,
but this is written in »ISO/IEC 9899:1999 (E) - Programming
Language C«. I have not found such a phrase in the HTML 4.01
Specification.
But let's forget the example for a moment. The HTML 4.01
specification still contains:
»Definition lists, created using the DL element, generally
consist of a series of term/definition pairs (although
definition lists may have other applications).«
So, there it is written outside of an example:
»other applications«.
But let's forget even this, an just look at the core:
»term/definition pairs«.
So, I might define a mapping f: -->
(in the strict mathematical sense of a /function definition/) as:
<dl>
<dt>0</dt><dd>0</dd>
<dt>1</dt><dd>2</dd>
<dt>2</dt><dd>4</dd></dl>
The left column has the possible argument values and the
right side defines the corresponding function value.
In mathematical wording, the dd element gives the function
value /defined/ for the argument values as given by the dt
element.
So this »definition« does not need to mean that »2« is being
defined as (equal to )1, it is defined as the /function value
of/ 1. This is a definition in the strict mathematical sense.
This is matched by the example
<DL>
<DT><STRONG>Lower cost</STRONG>
<DD>The new version of this product costs significantly less
than the
previous one!
<DT><STRONG>Easier to use</STRONG>
<DD>We've changed the product so that it's much easier to use!
<DT><STRONG>Safe for kids</STRONG>
<DD>You can leave your kids alone in a room with this product
and
they won't get hurt (not a guarantee).
</DL>
It gives a mapping (function) from aspects of a product to
explanation of these aspects.
This does not make it completely arbitrary, what one writes
into the dt and dd elemens, because all pairs must belong
to the same function. In the example it is the mapping from
aspects to explanations.
The HTML 4.01 specification also says:
»Another application of DL, for example, is for marking
up dialogues, with each DT naming a speaker, and each DD
containing his or her words.«
This perfectly agrees with my »mapping interpretation«, but
not with other restricted interpretation.
So there are at least three different parts of the
specification supporting my interpretation, two outside of an
example. Therefore, these three parts can not be all a slip of
the pencil, but reflect the deliberations of the authors of
the specification.
You seem to know better than what is written down and are
therefore able to judge which parts of the specification
are to be ignored as »false« and which are to be obeyed,
while I choose to take the specification and its wording
for what it says.
>You get some rendering, but other approaches actually give more
>easily styleable constructs.
I admit that I do not care much for visual rendition or
styling and therefore my suggestion indeed might not be the
best in this regard.
|
| Similar Threads | Posted | | Problem with descriptive lists in CSS | July 6, 2004, 2:54 am |
| A rendering problem with left aligned image and lists | August 13, 2004, 9:34 am |
| lists in tables | October 9, 2004, 5:43 am |
| Definition lists | March 3, 2008, 9:01 am |
| CSS display blocks and select lists in IE | July 16, 2004, 9:59 pm |
| the canonical structure of links in lists? | July 26, 2005, 4:31 am |
| Gracefully degrading expandable lists | January 24, 2006, 1:18 am |
| Good practice? Title attributes on lists of links | August 13, 2005, 4:04 pm |
| Need Help With Semantic Markup | October 12, 2004, 5:47 am |
| Markup Validator | April 5, 2007, 11:32 am |
|