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 07-11-2010, 10:51 PM   #1
justbobf
Junior Member
justbobf began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jul 2010
Device: iPad
How to properly format links so they validate and work, too?

I created a book in Adobe InDesign and exported it as an ePub.

I opened the ePub with Springy. (BTW, I'm on a Mac.) Each chapter was exported as a separate .xhtml file in the ePub. I had created a separate chapter for the Table of Content. I opened that file, which is the name-of-the-book-5.xhtml and I manually added links to the chapter names. The links looked like this:

<a href="name-of-the-book-1.xhtml">Chapter number</a>

This ePub validates with epubcheck-1.0.5. Trouble is, when put on the iPod, the links do not work.

So I added ../ to the links to make the iPod look in another file. The links now looks like this:


<a href="../name-of-the-book-1.xhtml">Chapter number</a>

Loaded this onto the iPod. Bingo! Links work. Trouble is, now the file does not pass the validation test.

Ideas?
justbobf is offline   Reply With Quote
Old 07-12-2010, 10:05 AM   #2
hkdorama
Member
hkdorama began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Jul 2010
Device: iPad, Sony Reader, Kindle 2
Quote:
<a href="name-of-the-book-1.xhtml">Chapter number</a>
Have you tried opening the file in Safari to see whether the link works there?
hkdorama is offline   Reply With Quote
Old 07-12-2010, 02:52 PM   #3
justbobf
Junior Member
justbobf began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jul 2010
Device: iPad
Excellent suggestion!

Yes, the file with the traditional internet links, without the "../", and the one that validates does link properly. The file with the "../" added does not.

But! the first time I tried this Safari reported that I did not have "permissions" to view the page.

I went back to the Finder and re-set Permissions so that I could Read & Write to all the files in the ePub. Then, the linked page would load.

So, could it be that the file permissions are being carried over to the iPod Touch? That might prevent the link from opening then, just as Safari would not open the link. Or, do permissions get dropped if the file is transferred to another computer? If I need to set permissions here, any idea what they would be? I can guess what the permissions would be, but what would the name be? "everyone", "system", "staff"? Any ideas?
justbobf is offline   Reply With Quote
Old 07-12-2010, 03:30 PM   #4
hkdorama
Member
hkdorama began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Jul 2010
Device: iPad, Sony Reader, Kindle 2
Could it be you took some files and then adjusted them for your book? Maybe somebody else's permissions were carried over with the files. Usually you do not have to deal with the permissions at all. The normal ones would be read and write for you and read only for others...
hkdorama is offline   Reply With Quote
Old 07-13-2010, 04:20 AM   #5
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 5,803
Karma: 4027751
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon
What is the directory structure inside the ePUB? Do you have a <base> tag or similar? Can we see a full (non-)working example?

It should work if you have a structure like this:

Code:
mimetype
META-INF
  container.xml
OEBPS
  content.opf
  TableOfContents.xhtml
  Chapter-1.xhtml
  Chapter-2.xhtml
  ...
and, inside "TableOfContents.xhtml" there's a link like:

Code:
<a href="Chapter-1.xhtml">Chapter One</a>
that's because "TableOfContents.xhtml" and "Chapter-1.xhtml" are in the same directory. By the way, "TableOfContents.xhtml" is included in the OPF file, right?
Jellby is offline   Reply With Quote
Old 07-15-2010, 07:57 PM   #6
justbobf
Junior Member
justbobf began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jul 2010
Device: iPad
Hello everyone.

Thank you all for your help.

Yes, the traditional links do work:

<a href="Chapter-1.xhtml">Chapter One</a>

I do not need the "../" in the link. Don't know what happened before. Maybe it is because I transferred the file to another user on my computer before loading it onto my iPod Touch. I don't have that iPod right now, so I cannot confirm that that is a problem; but, the epub does work as expected on a friend's iPhone and it does validate as expected with epubcheck-1.0.5.

So, I don't know what went wrong before, but all is fine, now. Thank you all, again. Your responses told me what to look for when trouble-shooting the files.

Oh! BTW, I opened Winnie-The-Pooh and found all permissions were set as
everyone: no access. If I edit a file by extracting it with Springy, I have to set it to
everyone: Read & Write
or else Springy won't let me overwrite the old file when I replace it with the new one, for what that is worth.
justbobf is offline   Reply With Quote
Reply

Tags
validation epub links

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Focus not properly shifting on links JSWolf Feedback 9 08-14-2010 06:12 PM
Kindle - html to Kindle format - do links to anchors work? Rasczak Kindle Formats 20 12-08-2008 03:20 PM
Links don't work ragdoll iRex 3 02-21-2008 01:47 PM
Tips on how to properly format ebooks for the Ebw-1150 Nate the great Fictionwise eBookwise 1 12-08-2007 11:23 PM


All times are GMT -4. The time now is 07:43 AM.


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