Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 02-11-2011, 04:24 PM   #1
frode frank
Junior Member
frode frank began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Feb 2011
Device: none
Problems with br

I’ve been finishing up a pretty long epub book, and somewhere along the line my <br />’s suddenly stopped working as expected. I tried Threepress’ validation service, and it turned up some errors. Most of them were easily fixed, but I keep getting:

ERROR: Pave Johanna.epub/content/kapittel2.html(57): element "br" from namespace "http://www.w3.org/1999/xhtml" not allowed in this context

And A LOT of them. I don’t know if this has something to do with why they’re not working as expected, but from what I’ve read here and elsewhere the problem should be fixed with a strict doctype setting. Problem is, it doesn’t help.

I’ve attached the .epub in question, and really hope someone can help me out. I suspect this is some stupid little error that causes a landslide of other errors.
Attached Files
File Type: epub test.epub (591.8 KB, 48 views)

Last edited by frode frank; 02-11-2011 at 04:35 PM. Reason: Updated document
frode frank is offline   Reply With Quote
Old 02-11-2011, 05:29 PM   #2
susan_cassidy
Wizard
susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.
 
Posts: 1,835
Karma: 1692648
Join Date: Jan 2009
Device: Kindle, iPad (not used much for reading)
In kapittel2.html, there are a bunch of br tags without a space before the closing slash. Maybe that's it?
susan_cassidy is offline   Reply With Quote
 
Enthusiast
Old 02-11-2011, 05:38 PM   #3
frode frank
Junior Member
frode frank began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Feb 2011
Device: none
Thank you. I fixed that, but it doesn’t help with my problem.
frode frank is offline   Reply With Quote
Old 02-11-2011, 06:00 PM   #4
frabjous
Wizard
frabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
frabjous's Avatar
 
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
I think in some species of XHTML, <br /> tags must always be inside other parent elements, so if <br /> is just sitting by itself, consider changing it to <p><br /></p> -- though I think you must also consider whether you really shouldn't instead simply add to the margins either below the previous paragraph or above the next paragraph in such cases (e..g, margin-bottom: 2ex; for the CSS for the paragraph above).
frabjous is offline   Reply With Quote
Old 02-11-2011, 07:04 PM   #5
DMSmillie
Enquiring Mind
DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'
 
DMSmillie's Avatar
 
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
frabjous nailed it - the <br/> tags are all sitting uncontained, rather than being inside a block level element such as P or DIV or a heading (H1, H2, etc). At the moment, the structure is kind of like this:

Code:
<p> ...stuff inside the P element... </p>
<br/>
<p> ...stuff inside next P element... </p>
The <br/> tag needs to be inside a block level element to be valid in XHTML Strict. You could either move it inside the preceding P element, or, as frabjous suggested, get rid of the <br/> and amend the CSS formatting to increase either the bottom margin of the preceding P or the top margin of the following P.

Last edited by DMSmillie; 02-11-2011 at 07:15 PM.
DMSmillie is offline   Reply With Quote
Old 02-11-2011, 07:13 PM   #6
DMSmillie
Enquiring Mind
DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'
 
DMSmillie's Avatar
 
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
Quote:
Originally Posted by susan_cassidy View Post
In kapittel2.html, there are a bunch of br tags without a space before the closing slash. Maybe that's it?
Just a minor "for info" on this - tags like BR which use a closing slash are valid XHTML with or without the space before the closing slash. The only reason for including the space is for backwards compatibility with browsers or other display applications that aren't XHTML compatible - they barf on the closing slash unless it's separated from the rest of the tag content by that space. If that kind of backwards compatibility isn't required, then it shouldn't matter if the space is included or not. The presence or absence of the space certainly shouldn't have any effect on validation.

Just thought I'd mention it, since I see the issue of that space before the closing slash come up every now and then in the forums.
DMSmillie is offline   Reply With Quote
Old 02-11-2011, 07:21 PM   #7
frode frank
Junior Member
frode frank began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Feb 2011
Device: none
Yeay! Working and valid. Thanks!
frode frank is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Firmware Update 3.01 - Anyone else have problems? JeremyR Amazon Kindle 9 09-15-2010 10:39 PM
I've got a few problems RubenRybnik Sony Reader 13 03-10-2010 10:06 PM
a few problems kceb10 Sony Reader 8 03-09-2010 07:09 AM
A few problems mand iRex 4 03-08-2009 10:42 AM


All times are GMT -4. The time now is 07:44 PM.


MobileRead.com is a privately owned, operated and funded community.