View Full Version : fixed layout landmarks issue


leijoninna
05-20-2013, 02:27 PM
I've been working on creating my very first fixed layout ePub3 for iBooks. After a lot of tweaking, I managed to get the epubcheck errors down to only one, and it doesn't make the file less functional:


element "nav" not allowed anywhere; expected the element end-tag or element "bindings"



This refers to the "landmarks" section in the opf file. I read on other forums and in documentation that the guide section has been deprecated and should be replaced with the landmarks. I've kept the guide section for backwards compatibility.

I also found one article (http://learn.infogridpacific.com/writer2/Landmarks.html) from about a year ago that referred to the landmarks section as not really being used by most readers (including iBooks). I tried my book on iPad, Readium an AZARDI, and none of them seem to really take any notice of neither the guide nor the landmarks section. For example, my "ibooks:reader-start-page" was completely ignored by all readers despite declaring the ibooks prefix.

So what is best practice here? Just go with the guide section, or keep landmarks and ignore the epubcheck error?

(btw, AZARDI makes my book look weird since it makes the front page the first odd page, and my first odd page an even page. Messes up all my two-page spreads…)

AlPe
05-20-2013, 06:50 PM
Almost certainly you have a syntax error in the toc.xhtml file. You should post the code, if you want help solving it. And you should consider solving it, because it might potentially break parsing the toc file.

BTW, the specs are here: http://www.idpf.org/epub/30/spec/epub30-contentdocs.html#sec-xhtml-nav-def-types-landmarks

leijoninna
05-21-2013, 10:28 AM
I was told that the landmarks section should be in the content.opf document. The opf is where the epubcheck error comes from. Or maybe I wasn't told, but it just hasn't been clear anywhere. And it would be the safest to assume since this is where the guide section was, that the landmarks should replace.

Is this not correct? Just want to make sure before I post any code. Otherwise, just tell me exactly where the landmarks section should be and it might be a quick fix.

There is most probably nothing wrong with the section itself, I have seen the spec and it looks exactly like it.

AlPe
05-21-2013, 10:36 AM
Now I undestand the error you get.

No, the landmarks usually go into the XHTML TOC which replaced the "old" NCX TOC.

Please read the specifications (I gave you the relevant link in the post above) and/or inspect some examples of EPUB 3 files, e.g. from:

http://code.google.com/p/epub-samples/

or

http://www.smuuks.it/index.php/en/projects

leijoninna
05-22-2013, 07:48 AM
Ok, thanks, now I have gotten rid of the error. It wasn't very clear in the documentation.

The ibooks:reader-start-page that some people suggest you can add to the landmarks section (to get the book to open there) still doesn't work. It is a declaration issue. Just putting it in gives the error Undeclared prefix: ibooks. I try to declare it in the html tag with:

prefix= "ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/"

...just like I did in the package tag in opf file without issues. But then the error is in the toc.xhtml - epubcheck says element "prefix" not allowed here.

I have added a screenshot of my toc.xhtml file with the prefix element added, if you can see anything wrong with it. (I have only one list item in the first nav list since I wanted ibooks to only show the visual TOC)

PeterT
05-22-2013, 09:35 AM
Did you look at this example of usage? https://github.com/reitermarkus/epub3-boilerplate/blob/master/Ebook/OPS/package.opf

Note that there is also a reference added to the <package> area

leijoninna
05-23-2013, 02:57 AM
Yes, I also use the reference in package in the opf file and there it works fine. But now that I moved the new landmarks section to the toc.xhtml I need to declare "ibooks" there as well, to not get an error. But it doesn't work, it says the element "prefix" is not allowed there.

Jim Lester
05-23-2013, 06:05 PM
I'm pretty sure 'prefix' is not a legal attribute for the html element, which is what the error is telling you.

Have you tried using a xml namespace declaration instead?
ie xmlns:ibooks ="http://vocabulary........"

leijoninna
05-24-2013, 12:46 PM
Thanks :) However, that was one of the first things I tried.

But, after studying the error and all the attributes that the epubcheck expected instead of "prefix", I did find one named "epub:prefix". So epub:prefix="ibooks: http://vocabulary....." did solve the error and there are no more issues in epubcheck.

I did not work anyway with the "ibooks:reader-start-page", it still opens up to the front page. So I guess that is a bit of a lost case.

Thanks for all the help, I will probably have more questions along the way. Great forum!

JSWolf
05-30-2013, 02:44 PM
Fixed layout in iBooks is not ePub. This thread should go in the Apple forum since it relates to iBooks which is an Apple product. If it related to ePub in iBooks, sure, this would be the appropriate forum. But as it's not part of ePub, it doesn't belong here.

JSWolf
05-30-2013, 02:45 PM
I'm pretty sure 'prefix' is not a legal attribute for the html element, which is what the error is telling you.

Have you tried using a xml namespace declaration instead?
ie xmlns:ibooks ="http://vocabulary........"

I know this is off-topic, but can you confirm the rumor of the 1.5 firmware for the nook STR?

leijoninna
06-14-2013, 04:24 AM
Fixed layout in iBooks is not ePub. This thread should go in the Apple forum since it relates to iBooks which is an Apple product. If it related to ePub in iBooks, sure, this would be the appropriate forum. But as it's not part of ePub, it doesn't belong here.

Which is the appropriate forum then? The only Apple forum I can find is the Apple Device forum. People there only seem to discuss devices, and coding questions are mostly left unanswered.