View Full Version : ePub Validation Problem


rlarrett
08-04-2010, 04:13 AM
I have built an ePub file, using Dreamweaver, Calibre, Sigil. It works fine in iBook (locally) and Adobe Digital Editions, looks great, and (of course) will not validate. I get this error message, over and over:

(name of book).epub/OEBPS/Text/jas_split_000.xhtml(64): 'OEBPS/Text/title_page': referenced resource missing in the package

The line of code highlighted is always an a href + id tag, which typically looks like this:
<h1 class="chead" id="calibre_pb_2"><a class="calibre1" href="contents" id="contents"></a>Contents</h1>

I took out the Calibre "a class" stuff, thinking that might be confusing matters, but it didn't help. I am at a total loss what to do. There are a lot of internal links in this book, for the index.

Any ideas would be greatly appreciated

charleski
08-04-2010, 07:39 AM
<a class="calibre1" href="contents" id="contents"></a>

Your href is malformed. What is this referring to? A file? An id within a file? In fact it looks as if this anchor is trying to link back to itself. All hrefs should specify the complete location: <filename>#<fragment id>.

rlarrett
08-04-2010, 09:48 AM
First off, thank you for your reply, charleski! All of the hrefs in question refer to named anchors in the body of the text, to which either the TOC, index, or footnote links point. In the example I offered, "Contents" is the anchor to which the link in the TOC page refers. And since the h1 tag is sufficient to place it in the TOC, and nothing links to it directly, that probably is dumb. The ID is identical to the href because I had no reason to make them different. Because, evidently, I have no idea what I am doing.

Most of the offending links are meant to be named anchors to "pages" in the book:
<a class="calibre1" href="p16" id="p16"></a>

This is meant to be a named anchor for page 16, to which the index can link. Which it does! But not in a good way, I guess. Any advice on what a non-malformed href might be like would be very appreciated! Hope this makes sense.

charleski
08-04-2010, 10:20 AM
You only need to include an href if you want the anchor to link back to something (ToC, index, etc). The id is the name of that particular anchor, the href is a pointer allowing the anchor to link to somewhere else.

E.g.:
Text.html:
<a id="XYZ_Text" href="Index.html#XYZ_Index">XYZ</a>

Index.html:
XYZ: <a id="XYZ_Index" href="Text.html#XYZ_Text">p16</a>

Click on 'XYZ' in the index and it'll take you to the page in the text where it's located. Click on 'XYZ' in the text and it'll take you back to the index entry for it.

If you don't need the link-back (which sounds like it's the case here), then you can drop the href (and the class, which is irrelevant since the anchor doesn't contain any text). So simply change them to <a id="p16" />.
Your html will then look like:

Text.html:
blah blah blah <a id="XYZ1" />XYZ blah
...
blah blah blah <a id="XYZ2" />XYZ blah

Index.html:
XYZ: <a href="Text.html#XYZ1">p16</a>, <a href="Text.html#XYZ2">p24</a>

Jellby
08-04-2010, 11:12 AM
Any advice on what a non-malformed href might be like would be very appreciated! Hope this makes sense.

First, you don't need an <a> element in order to provide a valid target for links, you can add the "id" attribute to any element and, if you want the anchor somewhere in mid-text, you could use <span id="p16"></span>, for instance, though charleski's suggestion of <a id="p16" /> is probably the best solution.

Second, the real problem is that your "href="p16"" actually links to a file name "p16", which does not exist; what you really mean is "href="#p16"", i.e., a link to the target named "p16" in the current file.

keriah
08-04-2010, 08:30 PM
...
Index.html:
XYZ: <a id="XYZ_Index" href="Text.html#XYZ_Text">p16</a>
...

Interesting... When I convert the Index of our print book I will, of course, have physical page numbers (like your "p16" example) in the source. But there aren't physical (stable) page numbers to point to in an iBook.

Sure, I can create the link, but what text should appear in the Index, rather than something like the "16"? IOW, what is are the recommended conventions for laying out the Index section of an ePub? And are there editors/tools that help with this?

theducks
08-04-2010, 10:16 PM
Interesting... When I convert the Index of our print book I will, of course, have physical page numbers (like your "p16" example) in the source. But there aren't physical (stable) page numbers to point to in an iBook.

Sure, I can create the link, but what text should appear in the Index, rather than something like the "16"? IOW, what is are the recommended conventions for laying out the Index section of an ePub? And are there editors/tools that help with this?

Sigil will build the nested TOC from Headings tags. It also provides a tool(TOC editor) that allows you to ignore certain header tags in the TOC context.

<h3>Chapter 42</h3>
No visible referent in the text? <h3 title="The big format fight scene"> </h3> :D

Sigil will make the linkage for you.

Adjust
08-04-2010, 10:43 PM
Sigil will build the nested TOC from Headings tags. It also provides a tool(TOC editor) that allows you to ignore certain header tags in the TOC context.

<h3>Chapter 42</h3>
No visible referent in the text? <h3 title="The big format fight scene"> </h3> :D

Sigil will make the linkage for you.

That would be great if he was talking about the TOC... ;)
He is talking about the index and if there is an auto feature somewhere which takes the nightmare of hyperlink index and puts in one nice little button to click on.

charleski
08-05-2010, 06:35 AM
Interesting... When I convert the Index of our print book I will, of course, have physical page numbers (like your "p16" example) in the source. But there aren't physical (stable) page numbers to point to in an iBook.

Sure, I can create the link, but what text should appear in the Index, rather than something like the "16"? IOW, what is are the recommended conventions for laying out the Index section of an ePub? And are there editors/tools that help with this?

There aren't any conventions on what to do in the absence of page numbers, so frankly you can can make up whatever you want here. You could simply use letters or symbols, but a logical way of handling it would be by chapter and paragraph, e.g. c512, c64, etc. The advantage of this is that it would retain a sense of how large the entry is: if you see multiple entries listed as c42, c615-62, c725, you'll realise that the second entry is the largest one and most likely to contain the information you're seeking.

keriah
08-05-2010, 09:48 AM
Thanks for the quick responses. And, yes, I am not worried about the TOC -- I have that part working, using a combination of Dreamweaver and eCub, plus some text edit tools to tweak and rezip the resulting .epub file.

After I posted this question I found a discussion by Liz Castro in her blog (http://tinyurl.com/2537fxa). It's an interesting approach ... and a lot of work! She discusses the rationale for retaining the print page number values in her epub index entries and provides a link to (draft) material on the pagelist function.

BTW, her new book (on ePub) has come out, and it is available in ePub format as well as paper. It has already answered another of my 'burning questions' from the book's preview pages: how to do a "keep together" so that a header doesn't appear alone, on the bottom of a page. Yeah. (That was going to be my next post here.)

Keri

charleski
08-05-2010, 11:54 AM
The real problem with Liz's approach is that the index links to the start of a 'page' rather than to the text where the entry appears. Since it's quite possible for a printed page to contain more text than a reader can display on a single screen (especially if you're reading the ebook on a small device like a cell phone), that means there's no guarantee that the index entry will take you to a screen which mentions the subject at all. This could cause obvious confusion and frustration if the user doesn't realise they might have to page forward one or two times to find the relevant text.

She's attempting to leverage the existing tools that InDesign provides, and that makes a lot of sense, but it's not really the best approach to the problem.

AbbyEscapades
09-17-2010, 05:24 PM
Hi, I have a similar error. I'm uploading our first epub file to itunes producer and come up with the following:

ERROR: CutthroatBusiness_ASavannahMartin.epub/OEBPS/Text/index_split_001.html(10): 'stylesheet.css': referenced resource missing in the package
ERROR: CutthroatBusiness_ASavannahMartin.epub/OEBPS/Text/index_split_003.html(10): 'stylesheet.css': referenced resource missing in the package
ERROR: CutthroatBusiness_ASavannahMartin.epub/OEBPS/Text/index_split_004.html(10): 'stylesheet.css': referenced resource missing in the package
ERROR: CutthroatBusiness_ASavannahMartin.epub/OEBPS/Text/index_split_005.html(10): 'stylesheet.css': referenced resource missing in the package
ERROR: CutthroatBusiness_ASavannahMartin.epub/OEBPS/Text/index_split_006.html(10): 'stylesheet.css': referenced resource missing in the package
ERROR: CutthroatBusiness_ASavannahMartin.epub/OEBPS/Text/index_split_007_split_000.html(10): 'stylesheet.css': referenced resource missing in the package
ERROR: CutthroatBusiness_ASavannahMartin.epub/OEBPS/Text/index_split_007_split_001_split_000.html(10): 'stylesheet.css': referenced resource missing in the package
ERROR: CutthroatBusiness_ASavannahMartin.epub/OEBPS/Text/index_split_007_split_001_split_001.html(10): 'stylesheet.css': referenced resource missing in the package
Check finished with warnings or errors!

When I look at the code for the stylesheet page in Sigil it looks fine but then again I don't know code. Feel free to talk to me like a kindiegardner.

Thanks,

Adjust
09-17-2010, 08:39 PM
Ok...We need to see your stylesheet.css and the index_split_001.html for starters.
as it's probably the same error for the rest of them

Jellby
09-18-2010, 05:17 AM
Could be just a problem of relative paths. If you have:

OEBPS/Text/index_split_001.html
OEBPS/Styles/stylesheet.css

then, in index_split_001.html you have to refer to "../Styles/stylesheet.css", and not just "stylesheet.css".

sudarsanam
10-07-2010, 02:06 AM
i am also learn



I have built an ePub file, using Dreamweaver, Calibre, Sigil. It works fine in iBook (locally) and Adobe Digital Editions, looks great, and (of course) will not validate. I get this error message, over and over:

(name of book).epub/OEBPS/Text/jas_split_000.xhtml(64): 'OEBPS/Text/title_page': referenced resource missing in the package

The line of code highlighted is always an a href + id tag, which typically looks like this:
<h1 class="chead" id="calibre_pb_2"><a class="calibre1" href="contents" id="contents"></a>Contents</h1>

I took out the Calibre "a class" stuff, thinking that might be confusing matters, but it didn't help. I am at a total loss what to do. There are a lot of internal links in this book, for the index.

Any ideas would be greatly appreciated