View Full Version : Validation Error from ePub Checker


sgirsberger
01-14-2012, 10:03 PM
Hello. I'm getting a specific kind of error from ePub Checker, which I hope will be easy to fix, once I figure out why there's a problem. I know someone here will spot this quickly and I'm happy to feel foolish but to learn from my mistake.

These errors apply to the text formatted in the attached sample, element ul sample.txt.


element "ul" from namespace "http://www.w3.org/1999/xhtml" not allowed in this context

Attribute name "ul" associated with an element type "ul" must be followed by the ' = ' character.


The one below applies to the text formatted in the attached sample, element p sample.txt


element "p" from namespace "http://www.w3.org/1999/xhtml" not allowed in this context


Lists will be the death of me! I keep thinking I have them figured out, and then something like this happens. Any advice will be greatly appreciated! Thank you!

Toxaris
01-15-2012, 04:41 AM
I took a quick look at the files. In the second file you have the following structure:

<ol>
<li>Some text</li>
<p>other text</p>
<li>...


The <p> is not allowed here. Within a <ol> only <li> can be used. In a <li> there can be a <p>. What you could do is the following:

<ol>
<li><p>Some text</br />
other text</p></li>
<li>...


For your first file, I believe it is not possible to have a unordered list within an ordered list.

sgirsberger
01-16-2012, 10:08 PM
Thanks, Toxaris. The problem, then, is having the numbering continue when an <ol> has a <ul> under it.

What I want to achieve is:

1. text text text

2. text text text


text that relates to list item 2


text that relates to list item 2


3. text text text

etc.

Sometimes there are subbullets; those are the <ul ul>. But it's my understanding that EPUB or more specifically, MOBI for Kindle, doesn't respect <start="x">, where x is the value for a beginning or continuing list item number, so that's why I wrap the <ul> into the <ol>? Works in web browsers, but maybe not in EPUB?

Jellby
01-16-2012, 11:02 PM
Right, ePub does not support the "start" property. In practice it is better to forget about lists and just hardcode the numbering/bulleting.

Toxaris
01-17-2012, 03:36 AM
But it's my understanding that EPUB or more specifically, MOBI for Kindle, doesn't respect <start="x">, where x is the value for a beginning or continuing list item number, so that's why I wrap the <ul> into the <ol>? Works in web browsers, but maybe not in EPUB?

As Jellby said, the propertie 'start' is not supported. The term 'respect' is not in order here, it is just not part of the specification.

As said many times on these forums, not everything from the XHTML/CSS 2.0 stack is in the specification of ePUB. If something works in a webbrowser, it does not say it will have to work in an ePUB reader. Lists are one of those things. Some things work, some don't.

sgirsberger
01-17-2012, 05:20 PM
Got it, Jellyby and Toxaris. I'll stop beating my head against a brick wall on this one. Thanks.

sgirsberger
01-17-2012, 05:20 PM
Sorry. I meant Jellby. Such a Dickensian sort of name!