Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Ordered lists, and how to break one up while still validating.

Reply
Thread Tools

Ordered lists, and how to break one up while still validating.

 
 
Mike Barnard
Guest
Posts: n/a
 
      03-23-2008
Yoohoo, it's me again.

How do you do large ordered lists, if you need to break them up with
headings yet still have it pass validation?

www.thermachek.com/temp/thelawdetail.php

This is an ordered list of 53 items, a breakdown of the 53 articles in
a UK law. The list is continious but broken by part headings. On
validation I get an error on each "Part1" "Part2" etc item;

Line 285, Column 3: document type does not allow element "H4" here;
assuming missing "LI" start-tag.
<h4>

I know what is wrong, I need to finish a list, do the heading then
start a new list. So I need the new list to start an a number other
than 1, where the previous list finished. The "start" property of the
<ol> has been deprecieated but no matching CSS has been created.

I have found a bodge for this at...
http://tb-one.se/2007/12/29/ol-start-number/
.... but it's a bit long winded. What would you do?

Leave it as it is? No validation but it works. (Must test in other
browsers than FF! Have not done so yet. Must get Safari to load too.)

Use the deprecieated 'start' property? No validation but *may* work in
more browsers?

Use the hack above? I will try it, but do you know of any problems
with it?

I look forward to having my eyes opened even wider! Happy Easter if
Easter is your thing.
 
Reply With Quote
 
 
 
 
BootNic
Guest
Posts: n/a
 
      03-23-2008
Mike Barnard <> wrote in
news::

> Yoohoo, it's me again.
>
> How do you do large ordered lists, if you need to break them up with
> headings yet still have it pass validation?
>
> www.thermachek.com/temp/thelawdetail.php
>
> This is an ordered list of 53 items, a breakdown of the 53 articles in
> a UK law. The list is continious but broken by part headings. On
> validation I get an error on each "Part1" "Part2" etc item;
>
> Line 285, Column 3: document type does not allow element "H4" here;
> assuming missing "LI" start-tag.
> <h4>
>
> I know what is wrong, I need to finish a list, do the heading then
> start a new list. So I need the new list to start an a number other
> than 1, where the previous list finished. The "start" property of the
> <ol> has been deprecieated but no matching CSS has been created.


Are you sure you need to restart the list?

Let's see, what you have is something like this:

<li>text</li>
<h4>heading</h4>
<li>text</li>

I think you understand the error. However there is another way to go about
doing what you want other then closing the list, add header then restart
the list.

What you can do is:

<li>text
<h4>heading</h4>
</li>
<li>text</li>

[snip]

--
BootNic Sunday March 23, 2008 2:30 PM
You can turn painful situations around through laughter. If you can
find humor in anything - even poverty - you can survive it.
*Bill Cosby*
 
Reply With Quote
 
 
 
 
Bergamot
Guest
Posts: n/a
 
      03-23-2008
BootNic wrote:
> Mike Barnard <> wrote in
> news::
>
>> How do you do large ordered lists, if you need to break them up with
>> headings yet still have it pass validation?
>>
>> www.thermachek.com/temp/thelawdetail.php

>
> What you can do is:
>
> <li>text
> <h4>heading</h4>
> </li>
> <li>text</li>


That doesn't look very logical.

If the list number really does need to resume on each list, it may be
better to use the deprecated start attribute on the <ol> than resort to
incorrect markup just to please the validator.

Validated code is not an end to itself, though some people seem to think
it is.

A nested list would be correct, too, I think. Like a table of contents.

<ol>
<li><hx>Section heading</hx>
<ol start="1">
<li>...

Looking at the page in question, though, I wonder what harm there is in
letting the lists restart numbering at 1.

--
Berg
 
Reply With Quote
 
Mike Barnard
Guest
Posts: n/a
 
      03-23-2008
On Sun, 23 Mar 2008 18:30:30 +0000 (UTC), BootNic
<> wrote:

>Mike Barnard <> wrote in
>news: :
>
>> Yoohoo, it's me again.
>>
>> How do you do large ordered lists, if you need to break them up with
>> headings yet still have it pass validation?
>>
>> www.thermachek.com/temp/thelawdetail.php
>>
>> This is an ordered list of 53 items, a breakdown of the 53 articles in
>> a UK law. The list is continious but broken by part headings. On
>> validation I get an error on each "Part1" "Part2" etc item;
>>
>> Line 285, Column 3: document type does not allow element "H4" here;
>> assuming missing "LI" start-tag.
>> <h4>
>>
>> I know what is wrong, I need to finish a list, do the heading then
>> start a new list. So I need the new list to start an a number other
>> than 1, where the previous list finished. The "start" property of the
>> <ol> has been deprecieated but no matching CSS has been created.

>
>Are you sure you need to restart the list?
>
>Let's see, what you have is something like this:
>
><li>text</li>
><h4>heading</h4>
><li>text</li>
>
>I think you understand the error. However there is another way to go about
>doing what you want other then closing the list, add header then restart
>the list.
>
>What you can do is:
>
><li>text
><h4>heading</h4>
></li>
><li>text</li>
>
>[snip]


Thanks Boot, I like the simple answers!
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      03-23-2008
Scripsit Mike Barnard:

> I know what is wrong, I need to finish a list, do the heading then
> start a new list. So I need the new list to start an a number other
> than 1, where the previous list finished. The "start" property of the
> <ol> has been deprecieated but no matching CSS has been created.


Right, so use the "start" attribute.

> Use the deprecieated 'start' property? No validation but *may* work in
> more browsers?


What do you mean by "No validation"? Validity is a formal thing, and a
document validates if you use document type definition (DTD) that
matches the actual markup. In this case, you can simply use HTML 4.01
Transitional. Even if this were not the case, "No validation" would not
be true; if you actually used an attribute not present in HTML
specifications, then you could say "Nonconforming markup" or even
(stretching the word "standard") "Nonstandard markup". But it would
still be valid if and only if you use a DTD that allows the markup.

Technically, the "start" attribute is presentational, so if it is
_essential_ that the items be numbered in a particular way, you should
put the numbers into actual content, e.g.
<li>1. Text of the item</li>
probably inside a <ul> element (since you dont want the
browser-generated numbers that <ol> produces at least when CSS is off)
with list-style-type: none.

But in practice, I think it is fairly safe the treat "start" as
semantic, i.e. to rely on the number being generated as specified by
this attribute.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
Mike Barnard
Guest
Posts: n/a
 
      03-23-2008
On Sun, 23 Mar 2008 14:22:29 -0500, Bergamot <>
wrote:

>BootNic wrote:
>> Mike Barnard <> wrote in
>> news::
>>
>>> How do you do large ordered lists, if you need to break them up with
>>> headings yet still have it pass validation?
>>>
>>> www.thermachek.com/temp/thelawdetail.php

>>
>> What you can do is:
>>
>> <li>text
>> <h4>heading</h4>
>> </li>
>> <li>text</li>

>
>That doesn't look very logical.


But, having tried it it works. It validates and works in all
browsers, so far.

>If the list number really does need to resume on each list, it may be
>better to use the deprecated start attribute on the <ol> than resort to
> incorrect markup just to please the validator.


Are there any browsers that ignore this deprecieated term, or wil it
kick in to quirks mode? Dunno.

>Validated code is not an end to itself, though some people seem to think
>it is.
>
>A nested list would be correct, too, I think. Like a table of contents.
>
><ol>
> <li><hx>Section heading</hx>
> <ol start="1">
> <li>...
>
>Looking at the page in question, though, I wonder what harm there is in
>letting the lists restart numbering at 1.


It's a legal document that continues 1 to 53. The numbers match with
the articles. Look at the link to the original and you'll see how they
match.

Thanks.

 
Reply With Quote
 
Bergamot
Guest
Posts: n/a
 
      03-23-2008
Mike Barnard wrote:
> On Sun, 23 Mar 2008 14:22:29 -0500, Bergamot <>
> wrote:
>
>>If the list number really does need to resume on each list, it may be
>>better to use the deprecated start attribute on the <ol> than resort to
>> incorrect markup just to please the validator.

>
> Are there any browsers that ignore this deprecieated term,


If it's valid in quirks mode, it will be supported even in standards
mode. I don't know of any browsers that ignore deprecated stuff
altogether. FWIW, I've always wondered why they deprecated the start
attribute, since it's not really presentational. It's part of the
content, at least to me.

> or wil it
> kick in to quirks mode?


Quirks mode is only triggered by the doctype, not by anything else in
the markup.

>>Looking at the page in question, though, I wonder what harm there is in
>>letting the lists restart numbering at 1.

>
> It's a legal document that continues 1 to 53.


OK, then I suggest using what makes sense for your particular document,
not just what the validator wants.

--
Berg
 
Reply With Quote
 
Blinky the Shark
Guest
Posts: n/a
 
      03-24-2008
Mike Barnard wrote:

> On Sun, 23 Mar 2008 14:22:29 -0500, Bergamot <> wrote:


> Are there any browsers that ignore this deprecieated term, or wil it
> kick in to quirks mode? Dunno.


Deprecated, Mike. Common scanning error. Just a heads-up.

Appropriately for this holiday some celebrate, there are religious roots
for the word: "[L. deprecatus, p. p. of deprecari to avert by prayer To
pray against, as an evil; to seek to avert by prayer; to seek deliverance
from; to express deep regret for; to desire the removal of."

If prayer fails, you'll have to remove the offending markup by hand.


--
Blinky
Killing all posts from Google Groups
The Usenet Improvement Project: http://improve-usenet.org
Blinky: http://blinkynet.net

 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      03-24-2008
Scripsit Bergamot:

> If it's valid in quirks mode,


That's an absurd sentence, like "if 1 + 1 equals 2 when printed on
paper". Validity is a formal property of a document. Nothing that a
browser might do in displaying the document cannot change that.

> Quirks mode is only triggered by the doctype, not by anything else in
> the markup.


Wrong. The presence or absence of a comment, for example, before the
doctype declaration is crucial on IE.

>> It's a legal document that continues 1 to 53.

>
> OK, then I suggest using what makes sense for your particular
> document, not just what the validator wants.


The last part "not just what the validator wants" is very strange. Are
you suggesting the use of invalid markup (which?), or are you just
saying that validity is not sufficient (which should be pretty obvious
anyway)?

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      03-24-2008
In article <>,
Mike Barnard <> wrote:

> How do you do large ordered lists, if you need to break them up with
> headings yet still have it pass validation?


First you make sure it is an ordered list. Just because a list has
numbers does not mean it is ordered in the meaning of "ordered list".
The meaning of order that is particularly relevant to an ordered list
can be a tricky matter. The folk who made up the css on this cannot be
blamed for not looking deeply into the matter, ordering and classifying
being a very complex linguistic human activity. They rested content on
probably no more than a couple of simple paradigms or examples. Thus:

If a shopping list, for example, consisted of dry groceries and were to
be purchased from a shop with a staff member behind a counter (as in the
good old days), then the order is unlikely to matter. But it might
matter if the items were to be purchased from different shops on a route
that minimised energy. If it matters which order the person is to get
things, then you would give an ordered list. If not, an unordered one.

However there might be within the one list a couple of categories of
things to be fetched, one in an order, the other in no particular order.
The logical way to list the items here would depend very much on the
exact circumstances. The main list might be an ordered one with suome
sub lists within the order which are unordered.

For example, your son should first take the dress item to be altered,
and while it is being altered should second go fetch the dry groceries
and third collect the dress item and take to dry cleaners for pressing.
This would be a 3 item ordered list with the second item having a sub
unordered list.

You can easily imagine and and find cases far more complex. Sometimes it
is quite a challenge to mark up. But the first thing is to settle what
it is your material is really meaning.

There are traps. The list might have numbers on them without being an
ordered list, where it would be actually wrong to use an OL. An example,
you send your son to the parts shop for some spare parts for something
and the items are in fact labelled with product numbers. You happen to
want consecutive numbers. It does not matter that it would be practical
for mnemonic purposes to list them in order. It is still an unordered
list. It does not matter what order the counter staff go off and fetch,
how they pack them in your bag, etc. The point is that all the items are
to be fetched in any order and they are all to be as specified. The
number may be a way to identify the items. This is not an ordering
matter but a matching matter. If you are wanting to use an html list,
you would use a ul but put in the numbers as part of the text in the
list item.

Or you would use a table! I have argued on more than one occasion at
some length that an ordered list is not more than a two column table in
the sense that each is as semantically as appropriate as the other. An
ordered list is not more than a 2 col table where the order is in one
col and the item in the other, the headings being either specified to
make clear what the number numbering means or else to be understood.

Normally I would say an unordered list has no exact semantic table
equivalent. But I make an exception for a special type of unordered
list. One in which the numbers are an identifying feature of the item
(rather than a call for action in the real world in a particular order -
as in an algorithm). The spare parts example is appropriate here. The
table would certainly be appropriate where the part number is on the
left and the item description on the right, row by row a very tabular
affair.

Be careful not to take on trust what is said to you on this Mike, think
through it all. Ask yourself what do the numbers mean?

You might conclude that the items you are dealing with *is* an ordered
list. (I even have some considerations to lend weight to that, I have
others, and more of them against it. But I won't trouble you with these
specific things). I have not discussed this. But the mere presence of
numbers is no guarantee. This does not mean you cannot lay things out as
you want. You can still have numbers and letters and whatever you want
as I have mentioned above, either in an unordered list or in a table).

I mention all this stuff so you can pick the most intelligent tool for
the job.

--
dorayme
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Ordered list inside ordered list DL Javascript 6 11-21-2009 11:43 PM
`if (!p ? i++ : 0) break;' == `if (!p){ i++; break;}' ? lovecreatesbea...@gmail.com C Programming 12 04-14-2008 07:59 AM
How to Intentionally Break a Digital Camera While Making it Look Like Normal Wear and Tear? Joebob Digital Photography 31 04-27-2005 10:02 PM
Why can I still hit the break point without the pdb file =?Utf-8?B?SmF6eg==?= ASP .Net 1 06-13-2004 02:46 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57