Forum Bugs

ordered list numbering incorrect

mischor
This sample, when formatted with no style sheet, displays as:
1. should be 1
2. should be 2
        • a bulleted item
2. should be 3
        • a bulleted item
2. should be 4
3. should be 5

Notice the ol counter seems to get "stuck" and not increment, when there's a following imbedded ul.
Here's the test case:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>title</title>
</head>
<body>
<ol>
    <li>should be 1</li>
    <li>should be 2</li>
    <ul>
        <li>a bulleted item</li>
    </ul>
    <li>should be 3</li>
    <ul>
        <li>a bulleted item</li>
    </ul>
    <li>should be 4</li>
    <li>should be 5</li>
</ol>
</body>
</html>

Marshall Schor
mikeday
The inner <ul> should be inside an <li>, as the <ol> and <ul> elements can only contain <li> elements, not other lists or block-level elements.
mischor
Hi Michael -

If I put the inner ul inside an li, the ul item ends up having both a "number" and a ul-disc marker, and the ol list items are again numbered incorrectly.

1.  should be 1
2.  should be 2
3.       * a bulleted item
4.  should be 3
5.       * a bulleted item
6.  should be 4
7.  should be 5


My markup was to surround the inner ul with a <li> .... </li>, per your suggestion that the inner ul has to be in side <li> .. </li> markers.

I tried both ways of markup in fireFox, Opera, and Amaya 9.51, and they all show the same behavior. Try dropping this into various browsers:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>title</title>
</head>
<body>
<p>Next ol has sub ul(s) not contained in li elements</p>
<ol>
    <li>should be 1</li>
    <li>should be 2</li>
    <ul>
        <li>a bulleted item</li>
    </ul>
    <li>should be 3</li>
    <ul>
        <li>a bulleted item</li>
    </ul>
    <li>should be 4</li>
    <li>should be 5</li>
</ol>
<p>Next ol has sub ul(s) contained in li elements</p>
<ol>
    <li>should be 1</li>
    <li>should be 2</li>
    <li><ul>
        <li>a bulleted item</li>
    </ul></li>
    <li>should be 3</li>
    <li><ul>
        <li>a bulleted item</li>
    </ul></li>
    <li>should be 4</li>
    <li>should be 5</li>
</ol>
</body>
</html>


Can you suggest another approach? -Marshall Schor
mischor
I figured out that if I treated the inner ul item as a part of the previous li item, then things work.

Here's the working code:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>title</title>
</head>
<body>
<p>Next ol has sub ul(s) contained in li elements</p>
<ol>
    <li>should be 1</li>
    <li>should be 2<ul>
        <li>a bulleted item</li>
    </ul></li>
    <li>should be 3<ul>
        <li>a bulleted item</li>
    </ul></li>
    <li>should be 4</li>
    <li>should be 5</li>
</ol>
</body>
</html>


This works in PrinceXML. I presume this is what you meant by your previous reply?

Thanks for listening :-)

-Marshall Schor
mikeday
Right, that's what I was thinking. :)
exeunt
I have an ordered list that is broken up:

<ol>
 <li>Step 1</li>
 <li>Step 2</li>
</ol>
<image ...>
<blockquote> </blockquote> .. etc
<ol start='3'>
 <li>Step 3</li>
</ol>


This works fine in HTML, however Prince seems to ignore the "start" attribute. Is there any workaround to this?
mikeday
At the moment the start attribute on <ol> is not supported, however you can achieve the same effect by using counter-increment or counter-reset as described here.

<ol>
<li>Step 1</li>
<li>Step 2</li>
</ol>
<blockquote> ... </blockquote>
<ol start='3' style="counter-reset: list-item 2">
<li>Step 3</li>
<li>Step 4</li>
</ol>

We will investigate adding support for the start attribute to the next release of Prince.