Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 03-18-2010, 12:34 AM   #1
Shiren
Connoisseur
Shiren will become famous soon enoughShiren will become famous soon enoughShiren will become famous soon enoughShiren will become famous soon enoughShiren will become famous soon enoughShiren will become famous soon enoughShiren will become famous soon enough
 
Shiren's Avatar
 
Posts: 70
Karma: 712
Join Date: Dec 2008
Device: Sony PRS-505/iPod Touch
Table of contents problems

I'm trying to link to files with anchors in my table of contents. I have something like this somewhere in a book2.xhtml file:
Code:
<a name="chap12">Chapter 12</a>
In my TOC.ncx file I have something like this:
Code:
<navPoint id="toc22" playOrder="22">
  <navLabel>
    <text>Chapter 12</text>
  </navLabel>
  <content src="book2.xhtml#chap12"/>
</navPoint>
My Sony reader and library do not work with this, they just open the next xhtml file instead. Calibre seems to accept it though. Am I doing something wrong?
Shiren is offline   Reply With Quote
Old 03-18-2010, 05:06 AM   #2
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: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
The "name" attribute is not valid in XHTML, use "id" instead, and not in an anchor element (<a>), i.e.:

Code:
<h1 id="chap12">Chapter 12</h1>
for instance. But apparently the Sony has problems with fragments (the "#" part in the href) in the NCX file, so it's better to avoid them if you can.
Jellby is offline   Reply With Quote
Advert
Old 03-18-2010, 07:51 AM   #3
Shiren
Connoisseur
Shiren will become famous soon enoughShiren will become famous soon enoughShiren will become famous soon enoughShiren will become famous soon enoughShiren will become famous soon enoughShiren will become famous soon enoughShiren will become famous soon enough
 
Shiren's Avatar
 
Posts: 70
Karma: 712
Join Date: Dec 2008
Device: Sony PRS-505/iPod Touch
Thank you, that did the trick. It seems to work well on my Sony.

The reason I need anchors is that I don't want to split my chapters into different xhtml files. I don't want the chapters to appear on a new page each time. Is there a way to do this with split chapters? That way I could avoid using anchors.
Shiren is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Table of Contents to ePub problems... cates Calibre 2 10-10-2010 04:18 PM
Table of Contents peterinnes Sigil 1 09-29-2010 03:03 AM
Problems with Table of Contents davers Sony Reader 3 12-25-2008 09:02 PM
only the table of contents wang960 Sony Reader 3 08-29-2008 12:45 PM
Creator Table of Contents Nate the great Kindle Formats 5 07-10-2008 05:55 AM


All times are GMT -4. The time now is 09:00 AM.


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