View Full Version : toc.ncx playOrder question


aarcane
03-05-2010, 12:56 AM
can the toc.ncx playOrder series have gaps in it ?

for example, I'm thinking about using the form 123456 for my books where 1 is the literal number 1, 23 is the book number in the series, 4 is a code for 0=title page, toc, prologue, etc. 1=chapters of the book, and 2= anything after the chapters.. so book 2 chapter 14 would look like 102114, but there might not be anywhere near 102114 entries before it (probably only 17 or so). is this valid, or do all the toc.ncx playOrder entries need to be perfectly sequential (1, 2, 3, 4, 5, etc..)

thanks in advance :)

charleski
03-05-2010, 02:25 AM
Not going to work I'm afraid:

The playOrder attribute is required on each pageTarget, navTarget and navPoint. It provides a means to collate all pageTargets, navTargets, and navPoints into a single ordered sequence that reflects their order in the normal playback sequence of the book as presented in the spine and SMIL file(s). playOrder is a positive integer; the first playOrder value in a document shall be 1. When the content elements of any pageTargets, navTargets, or navPoints reference the same SMIL time container, they must have the same playOrder value. playOrder must increase by one for each unique SMIL time container referenced by any pageTarget, navTarget or navPoint.
(emphasis added)
http://www.niso.org/workrooms/daisy/Z39-86-2005.html#NCXplay
as specified in
http://www.openebook.org/2007/opf/OPF_2.0_final_spec.html#TOC2.4.1.2

Of course, there are lots of epub readers out there that don't follow the spec properly, and might allow some arbitrary playOrder scheme. But it's best to create properly compliant epubs.

aarcane
03-05-2010, 02:36 PM
damn, thanks charleski.

On a slightly related note, does anyone make a decent toc.ncx editor ? something capable of drag/dropping entries in a toc.ncx file to reorder them, etc. that doesn't require editing the whole book with it.

JSWolf
03-05-2010, 05:00 PM
damn, thanks charleski.

On a slightly related note, does anyone make a decent toc.ncx editor ? something capable of drag/dropping entries in a toc.ncx file to reorder them, etc. that doesn't require editing the whole book with it.

That would be a nice thing if anyone had such.

bobcdy
03-05-2010, 05:10 PM
Won't notepad++ work in Windows? I'm not an expert with notepad++ but I tried it on an unzipped epub tox.ncx and it opened it (it's a text file) and drag/drop seemed ok.

aarcane
03-05-2010, 11:58 PM
bobcdy even notepad will drag and drop them, it's the playOrder="n" that needs to be modified, and changing it by hand is a pain when you've just reordered 1 item from the end of the 50 chapter book to the Beginning because on review you find it works better there.

Jellby
03-06-2010, 03:52 AM
With vim you can use this single command:

let n=1 | g/playOrder/s/playOrder="\d\+"/\='playOrder="'.n.'"'/ | let n=n+1

To automatically generate a correct sequence of playOrder.

In future versions of the ePUB spec, the playOrder attribute will probably be made optional, though.

sjkramer
03-08-2010, 03:27 PM
This relates to something I've been wondering about, which is decimal values in the play order. I decided to try it out when adding a chapter between two existing points (rather than renaming each subsequent point). Originally I had points 1 and 2. When adding the paragraph in between, I identified it as 1.5. It seems to work properly, but I have a nagging feeling that it wasn't strictly correct.

gardefjord
05-25-2010, 05:00 AM
Me being stupid, but how exactly do you drag-and-drop a navpoint in notepad?