12-23-2009, 06:56 PM | #1 |
Member
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. |
12-24-2009, 05:31 AM | #2 |
frumious Bandersnatch
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 |
Advert | |
|
12-24-2009, 05:33 AM | #3 |
Connoisseur
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.
|
12-24-2009, 08:08 AM | #4 |
Created Sigil, FlightCrew
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
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.
|
Thread Tools | Search this Thread |
|
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 |