View Single Post
Old 04-15-2012, 10:07 AM   #2
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,553
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'm not exactly sure why you think it's necessary to "trim" things that you may not understand, but I can assure you that removing the namespace declaration(s) for an NCX or OPF file will definitely render them useless to most reading systems. The URIs in those XML namespace declarations are not "accessing the internet," and you can't just remove them simply because your epub won't ever "access the internet." That's not what they're for.

Also the NavPoint ID is required by spec... and removing the <content /> tags would make the point of creating an NCX file in the first place, rather moot. No href = no functionality.

Why the "Trimming" obsession, anyway? I'm genuinely curious. These two files don't really have any "fat" in them to begin with (with the exception of maybe a few items between the <metadata></metadata> and <guide></guide> tags of the OPF). The rest is really quite critical—unless you want to eliminate the NCX completely. There's no requirement that you have to have an NCX, but removing it will probably require an alteration to your OPF file... if you're copying them from preexisting, functional ePubs.

Quote:
I've noticed there's a lot of code that might be useless in the metadata.opf and toc.ncx file
Using this assumption as the basis for your learning/experimentation is probably not the best idea. Wouldn't it be better to assume that portions of code are required—until you learn otherwise?

OPF specs
NCX specs

Last edited by DiapDealer; 04-15-2012 at 11:38 AM.
DiapDealer is offline   Reply With Quote