Reordering NCX playOrder
When you make changes to the TOC.NCX file in an ePUB—moving front matter to the back of the ePUB; adding additional content—one of the frustrations is that the playOrder in the TOC.NCX file has to be renumbered. If your book has a short TOC.NCX this might not be a challenge, but if you have a long book or have nested multiple levels of heads in the TOC.NCX, this can be very time-consuming to do manually. I’ve been looking for a way to automatically reorder the playOrder for some time. David Golding (@digidg) posted a couple links on Twitter to scripts that will do just that. One is in XSL; the other is in Vim. Rick Gordon (@rhgordon) has an AppleScript that will do the same. These should makes things easier the next time you need to renumber your TOC.NCX.
I’m still looking for the elusive Perl script that is reported to be out there. If you have one or know where to find one, please leave the URL in the comments. Do you have other script your use for reordering the playOrder?