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 12-23-2009, 06:56 PM   #1
erik5000
Member
erik5000 began at the beginning.
 
Posts: 15
Karma: 12
Join Date: Nov 2009
Device: sony prs600
NCX playOrder nuisance

playOrder in the NCX file is a real nuisance. And unnecessary too: the playOrder follows directly from the order of the navPoints in the NCX file.
There may be no gaps in the playOrder: 10,20,30 etc is not allowed. It MUST be 1,2,3,4,5 etc

But anyway: I built myself a short AWK script to renumber the playOrder attributes. You can use it from the command line or from an ANT build script.
The result will be in the file "tempFile".

Here is the AWK wiki: http://en.wikipedia.org/wiki/AWK
# this AWK script corrects any mistakes in the playOrder of EPUB NCX files.
# use it in an ANT build script.
# the entire phrase playOrder="234" must be on ONE line !!

BEGIN {counter = 1 }
{

if (match($0, /playOrder="[0-9]*"/ ) )
{
repl = "playOrder=\"" counter "\""
sub(/playOrder="[0-9]*"/, repl )
counter++;
}
print $0 > "tempFile"
}

Last edited by erik5000; 12-24-2009 at 09:42 AM.
erik5000 is offline   Reply With Quote
Old 12-24-2009, 05:31 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,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
I use a vim command ('cause I edit the files with vim):

Code:
:let n=1 | g/playOrder=/s/playOrder=".\{-}"/\='playOrder="' . n . '"'/ | let n=n+1
note: they are discussing the playOrder attribute at IDPF, it might be optional in the next ePUB spec revisions.
Jellby is offline   Reply With Quote
Advert
Old 12-24-2009, 05:33 AM   #3
quillaja
Connoisseur
quillaja began at the beginning.
 
quillaja's Avatar
 
Posts: 79
Karma: 42
Join Date: Sep 2009
Device: sony reader touch (prs-600)
you can just let them all be 0, i think. i've done that, and the TOC works on my prs-600.
quillaja is offline   Reply With Quote
Old 12-24-2009, 08:08 AM   #4
Valloric
Created Sigil, FlightCrew
Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.
 
Valloric's Avatar
 
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
Quote:
Originally Posted by quillaja View Post
you can just let them all be 0, i think. i've done that, and the TOC works on my prs-600.
There's a difference between what works on one device, and what is standards-compliant. Because other devices may behave differently is why we have standards in the first place.
Valloric is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Page Mapping Using toc.ncx lorddon ePub 35 01-16-2018 12:18 PM
NCX creation -- nested or not, css classes illustrata ePub 3 08-25-2010 08:56 AM
Can you bypass first two items in TOC.ncx? sueneu Kindle Formats 4 07-14-2010 08:36 AM
toc.ncx playOrder question aarcane ePub 8 05-25-2010 05:00 AM
HTML, NCX & OPF --> MESS pakiyabhai Workshop 2 12-22-2009 10:43 AM


All times are GMT -4. The time now is 06:53 AM.


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