View Full Version : Could somebody help with src and alt, please?


GillianMary
10-08-2010, 06:10 AM
Hi, could somebody help me to correct an image error I get when trying to validate:


Valhai-epub.epub is NOT valid
1. ERROR: Valhai-epub.epub/OEBPS/Text/Cover.xhtml(18): required attributes missing
2. Check finished with warnings or errors!


I have absolutely no idea how to include correct alt and src values... just followed the instructions in the “A basic Sigil tutorial”. The cover shows up perfectly, and all is working well, but Threepress gave the above error. I tried changing some of the names of the image etc, but got nowhere.
Have copied the code below. Would really appreciate some help. Thanks.

<?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">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ebook copy for formatting.xhtml</title>
<link rel="stylesheet" href="../Styles/template.css" type="text/css" />
<style type="text/css">
/*<![CDATA[*/
span.sgc-1 {font-family: Arial; line-height: normal; font-size: medium;}
/*]]>*/
</style>
</head>
<body>
<div class="generated-style" id="ebook-copy-for-formatting">
<p class="basic-paragraph basic-paragraph-override" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-gb"><span class="no-style-override-2 sgc-1"><img src="../Images/ebook%20cover.jpg" /></span></p>
</div>
</body>
</html>

:thanks:

charleski
10-08-2010, 07:42 AM
<?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">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ebook copy for formatting.xhtml</title>
<link rel="stylesheet" href="../Styles/template.css" type="text/css" />
<style type="text/css">
/*<![CDATA[*/
span.sgc-1 {font-family: Arial; line-height: normal; font-size: medium;}
/*]]>*/
</style>
</head>
<body>
<div class="generated-style" id="ebook-copy-for-formatting">
<p class="basic-paragraph basic-paragraph-override" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-gb"><span class="no-style-override-2 sgc-1"><img alt="cover" src="../Images/ebook%20cover.jpg" /></span></p>
</div>
</body>
</html>



All <img> tags need to have an alt attribute that gives the text that would be read out by a screen-reader. The standard requires this to promote accessibility for the visually-impaired. The text for alt can be blank
(alt="") for images which are purely stylistic flourishes, but you're encouraged to use meaningful text where appropriate.

GillianMary
10-08-2010, 08:12 AM
Wow! I never expected a reply so quickly. Fantastic.

It now got:


VALHAI-EPUB.EPUB IS VALID!
PREFLIGHT REPORT
Epubpreflight runs some of the same validation as epubcheck, but additionally checks for problems like very large file sizes that might affect some reading systems

Thank you so much, I really appreciate your taking the time to help me.

:2thumbsup