Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 11-17-2013, 01:07 PM   #1
frisket
Member
frisket began at the beginning.
 
Posts: 14
Karma: 10
Join Date: May 2011
Device: Kindle
Unhappy Fragment identifiers

I am learning about the internals of the EPUB3 standard by writing my own transformation in XSLT2, using my thesis as an example text. Most of it is going excellently, but I am having some trouble understanding how the links between the toc.ncx and the documents are meant to work.

I am getting "ERROR: OEBPS/toc.ncx(25,47): 'd1e97': fragment identifier is not defined in 'OEBPS/index.xhtml'" (and others) from the online validator at ebookit.com for this:

21 <navPoint id="d1e97" playOrder="3">
22 <navLabel>
23 <text>Dedication</text>
24 </navLabel>
25 <content src="index.xhtml#d1e97"/>
26 </navPoint>

where index.xhtml says:

<div class="dedication" id="d1e97">
<p>To xxxx, yyyy, zzzz for their patience
and support.
</p>
</div>

Given that you are not allowed by EPUB3 to use <a name="..."> (the ebookit validator marks all occurrences of that as an error), what is the mechanism for the resolution of these links? What is the fragment identifier in line 25 supposed to point at? if not a name attribute on an <a> element, or an ID?
frisket is offline   Reply With Quote
Old 11-17-2013, 01:34 PM   #2
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
I don't know much about this, but it seems like you need full paths to files, or an indicator that is it relative to some other file.
mrmikel is offline   Reply With Quote
Advert
Old 11-23-2013, 06:06 PM   #3
frisket
Member
frisket began at the beginning.
 
Posts: 14
Karma: 10
Join Date: May 2011
Device: Kindle
Quote:
Originally Posted by mrmikel View Post
I don't know much about this, but it seems like you need full paths to files, or an indicator that is it relative to some other file.
But the index.html is in the same (OEBPS) directory of the .epub file as the toc.ncx, so I don't know how much fuller it can be.
frisket is offline   Reply With Quote
Old 11-23-2013, 07:03 PM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,803
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by frisket View Post
But the index.html is in the same (OEBPS) directory of the .epub file as the toc.ncx, so I don't know how much fuller it can be.
fragments are NOT relative to the TOC (index.html), but to the file that contains the anchors id

#foo1 says in the same file
chapter1.html#foo1 says look in chapter1.html for foo1

The first case will get broken (in Sigils auto link rename) if the file splits from when the link was set

the second survives, thus the suggestion to always use full names. it is more robust (and easier to track down if it does get broken)
theducks is offline   Reply With Quote
Old 11-24-2013, 01:08 PM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I have no idea what the validator for ebookit.com is based on on, but I know the gist of what you've posted is perfectly valid. Make sure you use the IDPF's validator (http://validator.idpf.org/) to eliminate any possibility that ebookit.com's validator is the culprit.

I've validated several epub3 documents where the (x)html file and the toc.ncx file were in the same directory. Same basic "index.html#frag" pointing to an element with the id="frag" syntax. It should work fine, so there must be something else wrong.
DiapDealer is offline   Reply With Quote
Advert
Old 11-25-2013, 05:22 PM   #6
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by frisket View Post
I am getting "ERROR: OEBPS/toc.ncx(25,47): 'd1e97': fragment identifier is not defined in 'OEBPS/index.xhtml'" (and others) from the online validator at ebookit.com for this:

21 <navPoint id="d1e97" playOrder="3">
22 <navLabel>
23 <text>Dedication</text>
24 </navLabel>
25 <content src="index.xhtml#d1e97"/>
26 </navPoint>

where index.xhtml says:

<div class="dedication" id="d1e97">
<p>To xxxx, yyyy, zzzz for their patience
and support.
</p>
</div>

Given that you are not allowed by EPUB3 to use <a name="..."> (the ebookit validator marks all occurrences of that as an error), what is the mechanism for the resolution of these links? What is the fragment identifier in line 25 supposed to point at? if not a name attribute on an <a> element, or an ID?
You don't actually need #d1e97 in line 25 since all you are doing is going straight to the beginning of index.xhtml. So just remove #d1e97 and any others like it and the errors will be gone.
JSWolf is offline   Reply With Quote
Old 11-25-2013, 09:43 PM   #7
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
How on earth can you possibly deduce from the code snippets provided that the link from the TOC can just go "straight to the beginning of index.xhtml" ?
DiapDealer is offline   Reply With Quote
Old 11-25-2013, 10:56 PM   #8
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by DiapDealer View Post
How on earth can you possibly deduce from the code snippets provided that the link from the TOC can just go "straight to the beginning of index.xhtml" ?
Because index.xhtml is a dedication page. Other then the XML code that's not being displayed, it's complete codewise.
JSWolf is offline   Reply With Quote
Old 11-26-2013, 05:23 AM   #9
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Why would you assume that index.xhtml is the dedication page only?
DiapDealer is offline   Reply With Quote
Old 11-26-2013, 05:39 AM   #10
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
Quote:
Originally Posted by frisket View Post
I am learning about the internals of the EPUB3 standard [...] the links between the toc.ncx and the documents
Wasn't the NCX file deprecated in EPUB3?
Jellby is offline   Reply With Quote
Old 11-26-2013, 12:42 PM   #11
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
It still can still be included for various backward compatibility reasons. It will still pass the idpf's epubcheck with an ncx. But yeah, it's been replaced by the nav document.
DiapDealer is offline   Reply With Quote
Old 03-28-2014, 05:13 PM   #12
frisket
Member
frisket began at the beginning.
 
Posts: 14
Karma: 10
Join Date: May 2011
Device: Kindle
Just got back to this...thanks everyone for the suggestions. I had assumed (duh) that because the IDs have to be unique across the documents, just the fragment identifier without the filename would work. Add the filenames and it's fine. The reason for fragment identifiers even when going to the top of the file was that the "top" isn't actually where I wanted to send users, it was one element down (just a matter of alignment).

Now I have a single XSLT2 program to generate all the files, plus a little script that extracts all the image filenames from figures, and copies them all into the epub directory, then zips everything up and creates the .epub file. Now comes the task of testing in all the common readers, and making something that Calibre can open and translate reliably to all the formats.
frisket is offline   Reply With Quote
Old 03-29-2014, 07:36 AM   #13
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
As you are doing your work, be aware that calibre's viewer is NOT guaranteed to display all possible varieties of epub3 and that if it does work, it may not in subsequent editions. It exists to support the other functions, not to serve as anybody's viewing platform.
mrmikel is offline   Reply With Quote
Old 03-29-2014, 01:56 PM   #14
frisket
Member
frisket began at the beginning.
 
Posts: 14
Karma: 10
Join Date: May 2011
Device: Kindle
Quote:
Originally Posted by mrmikel View Post
As you are doing your work, be aware that calibre's viewer is NOT guaranteed to display all possible varieties of epub3 and that if it does work, it may not in subsequent editions. It exists to support the other functions, not to serve as anybody's viewing platform.
Indeed not, but it makes a starting-point. I have a team of volunteers with different devices to do the hand-on checking.
frisket is offline   Reply With Quote
Old 03-30-2014, 07:05 AM   #15
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
Unfortunately, it looks that will be required from now on. There was some attempt toward working to spec for epub2, but for epub3, the device manufacturers aren't even trying, with Apple and Kindle not complying with anything.
mrmikel is offline   Reply With Quote
Reply

Tags
fragment, identifier, ncx, toc


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fragment Identifier missing, but looks OK flypig ePub 8 12-19-2018 06:58 PM
FRAGMENT ERROR MESSAGE dgbeig ePub 5 11-23-2013 07:21 PM
Bulk edit of identifiers rmagere Library Management 4 02-19-2012 04:10 AM
Search on Identifiers Field nynaevelan Library Management 2 01-25-2012 06:13 PM
Modifying Identifiers Fabe Sigil 6 01-11-2012 07:46 AM


All times are GMT -4. The time now is 02:14 AM.


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