Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 06-01-2015, 01:06 PM   #1
bushman1
Junior Member
bushman1 began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jun 2015
Device: none
epub validation error

Hello Forum,
I am trying to format a manuscript and I have run into one problem that I have not been able to solve. A simple strike through piece of text. It fails the epub validator (http://validator.idpf.org/)

This is the HTML/CSS. Very simple. It displays fine on ereader and browser but fails with error code... ERROR EPUB test.html line 10 position 72 attribute "class" not allowed here; expected attribute "cite" or "datetime"

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<head>
<style type="text/css"> html, body, div, h1, h2, h3, h4, h5, h6, ul, ol, dl, li, dt, dd, p, pre, table, th, td, tr { margin: 0; padding: 0em; }
p {text-indent: 1.5em; margin-bottom: .2em;}
</style>
</head>
<body>
<p>I&rsquo;d just pull out my handy <del>abacus , slide rule</del> , calculator to do my figuring. </p>
</body>

Everything I've researched says that is valid HTML. All I want is for the specific text to have a strike through. Tag "s" fails also but is being replaced with the newer "del" tags. The cite and datetime are supposed to be optional attributes but the validator seems to be insisting on attributes. Does anybody have a clue why the epub validator is having a problem with this? Is it a validator bug? Thank you so much for any input.
bushman1 is offline   Reply With Quote
Old 06-01-2015, 01:18 PM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
It is valid HTML, but not valid XHTML. Since ePUB must contain XHTML, it will not work. You should use the following:
Code:
.strike {text-decoration: line-through;}
in the stylesheet and in the XHTML:
Code:
<p>I&rsquo;d just pull out my handy <span class="strike">abacus , slide rule</span> , calculator to do my figuring. </p>
Toxaris is offline   Reply With Quote
Old 06-01-2015, 01:49 PM   #3
bushman1
Junior Member
bushman1 began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jun 2015
Device: none
Toxaris...

Results: Congratulations! No problems were found.

You are a wizard. You are awesome. Thank you very much for your prompt help. I implemented your suggestion and it passed the validator. A good lesson learned. I need to pay attention to the X HTML. Have a great day!!
bushman1 is offline   Reply With Quote
Old 06-04-2015, 12:09 AM   #4
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
And IIRC, there's also no requirement in the spec that a reader must render <del> as a strike-through, so even if you were using HTML 5/EPUB 3, you'd still be better off using CSS.
dgatwood is offline   Reply With Quote
Old 06-05-2015, 01:50 AM   #5
bushman1
Junior Member
bushman1 began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jun 2015
Device: none
Thanks dgatwood. That was a great answer from Toxaris and solved the problem.
bushman1 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ePub Validation Error sn12 ePub 8 03-08-2012 11:44 AM
Epub Validation Error DTurner ePub 6 09-12-2011 05:13 PM
ePub validation error -- what? Yuroc ePub 2 08-16-2011 01:29 PM
Epub Validation Error? LadyDae ePub 6 10-29-2010 07:20 PM
ePub Validation Error mrbillb ePub 6 09-28-2010 02:14 PM


All times are GMT -4. The time now is 12:18 PM.


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