View Full Version : ePub validation error help "attribute border is not declared for element img


bmacklin
09-18-2012, 09:30 AM
Error message in the ePub validator via Sigil is
"attribute border is not declared for element 'img'

Here's what the code looks like

<p class="MsoNormal"><span class="calibre1" xml:lang="EN"><img alt="" border="0" class="calibre16" src="../Images/image002.jpg" /></span></p>


I have 160 images and about the same number of errors such as this.

the original doc was in Word, I converted to web filtered, converted via calibre and checked it out on Sigil.

Can anyone help me with a solution?

cheers
Ben

mzmm
09-18-2012, 10:28 AM
the border attribute isn't valid xhtml which is probably why epubcheck is throwing errors. if your images have borders you should be styling them with css, ie

.myclass {border: 1px solid black;}

<img class="myclass" src="../images/my_img.jpg"/>

and then removing the border attribute in the html. if you're just trying to get rid of the attribute and don't need to worry about styling borders, you can unzip the epub and do a global find/replace on all your html documents, replacing border="0" with an empty 'replace' field. not sure if there's a way to do this in sigil or to control the output to html in word, though.

Toxaris
09-18-2012, 10:34 AM
You can also just load the filtered HTML directly in Sigil and cleanup there. There will be less mess to clean up then... Calibre does not produce very clean conversions for this.

bmacklin
09-18-2012, 08:15 PM
Thank you both Toxaris and MZMM. You both rock.
But...I'm a really not familiar with HTML or CSS so I'll need a step by step guide.
This is what I am hearing from you. Let me know if I have this correct.

Firstly, I don't need/want to style any borders on images in the document. That is ...the images do not need any additional border styling.

1. I can load the filtered HTML into Sigil
2. From there I can do a global find/replace 'border "0" with empty 'replace' field.

Now I'm not sure I know exactly what an empty 'replace' field is..... Are you just saying replace 'border "0" with the equivalent of nothing...so just deleting it.

I'd appreciate some additional clarity. You have given me hope that I just might be able to solve this problem !!!
cheers
Ben

JSWolf
09-18-2012, 08:26 PM
Error message in the ePub validator via Sigil is
"attribute border is not declared for element 'img'

Here's what the code looks like

<p class="MsoNormal"><span class="calibre1" xml:lang="EN"><img alt="" border="0" class="calibre16" src="../Images/image002.jpg" /></span></p>

You should remove the xml:lang="EN" that is not needed and just bloats the code.

bmacklin
09-18-2012, 08:55 PM
Thank you JSWolf.

bmacklin
09-19-2012, 09:21 PM
Hello,
I fixed all my problems and Sigil said "no problems".
I submitted to Bookbaby and it came back with a bunch of the following messages

BK00009767/original/BK00009767.epub/OEBPS/Text/MUTATIONS EBOOK Format16Sept UPDATED_split_000.htm: Filename contains spaces.

This error occurs on each split.

It doesn't seem like a major problem but not sure how to tackle it.
Help?

Here is the code for split_000.htm


<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!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>
<meta content="Microsoft Word 14 (filtered)" name="Generator" />

<title>Unknown</title>
<link href="../Styles/stylesheet.css" rel="stylesheet" type="text/css" />
<link href="../Styles/page_styles.css" rel="stylesheet" type="text/css" />
<style type="text/css">
/*<![CDATA[*/

:link { color: blue }
:visited { color: purple }
p.sgc-1 {font-weight: bold}
/*]]>*/
</style>
</head>

<body class="calibre">
<div class="WordSection">
<p class="MsoNormal"><span class="calibre1"><img alt="" class="calibre2" id="Picture_1" src="../Images/image001.jpg" /></span></p>

<p class="MsoNormal"><span class="calibre1" xml:lang="EN-US">&nbsp;</span></p>

<p class="MsoNormal"><span class="calibre1" xml:lang="EN-US">&nbsp;</span></p>

<p class="MsoNormal"><span class="calibre3" xml:lang="EN-US">Presented by</span></p>

<p class="MsoNormal"><span class="calibre3" xml:lang="EN-US">Susanne Russo</span></p>

<p class="MsoNormal"><span class="calibre3" xml:lang="EN-US">&nbsp;</span></p>

<p class="MsoNormal calibre4 sgc-1"><span class="calibre3" xml:lang="EN-US">Copyright 2001-2012 Susanne Russo, all rights reserved.</span></p>

<p class="MsoNormal"><span class="calibre1" xml:lang="EN-US">No portion of this book may be reproduced or distributed without the permission of Susanne Russo. Feel free to email me:</span> <span class="calibre1" xml:lang="EN-US"><a class="calibre1" href="mailto:cockatiel.mutations%20@gmail.com"><span class="calibre1">cockatiel.mutations @gmail.com</span></a></span></p>
</div>
</body>
</html>

Toxaris
09-20-2012, 02:53 AM
Quick question. The error actually gives you the problem and also the solution. What you did not mention here, is that you create books for clients. Why don't you make sure you know the format and at least basic HTML and CSS?

bmacklin
09-20-2012, 08:05 AM
I'm learning quickly Toxaris. I've been primarily concentrating on text based novels. The most recent book had 160 images. It required a different set of skills and presented some new challenges. That is why I am here asking for assistance.
cheers
Ben

DiapDealer
09-20-2012, 08:54 AM
What you did not mention here, is that you create books for clients. Why don't you make sure you know the format and at least basic HTML and CSS?
I'm learning quickly Toxaris.
Learn. THEN clients.

DaleDe
09-20-2012, 01:21 PM
Hello,
I fixed all my problems and Sigil said "no problems".
I submitted to Bookbaby and it came back with a bunch of the following messages

BK00009767/original/BK00009767.epub/OEBPS/Text/MUTATIONS EBOOK Format16Sept UPDATED_split_000.htm: Filename contains spaces.

This error occurs on each split.

It doesn't seem like a major problem but not sure how to tackle it.
Help?



It is telling you exactly what it does not like. It is not the contents of the file that it is complaining about, it is the title of the file. References to filename means the name of the file not the contents of the file. It would seem that the file name is actually "16Sept UPDATED_split_000.htm" which has a space in the name. Use Sigil to bring up the ePub and look in the filenames in the left column.

It is never a good idea to have spaces in any filename that is used in an ePub even though some tools will let you get away with it.

Dale

bmacklin
09-20-2012, 08:22 PM
Thank you Dale