Until today, I was exporting ePub files from Pages. It produces XHTML ePub files, which I then edited in BBEdit. The edits worked, but there were myriad other problems, so…
…I bought CS5.5 and…
I noticed several things:
1. InDesign 5.5 doesn't export XHTML formatted files, but HTML.
2. When I checked the syntax of these files in BBEdit, there were the following errors:
Unknown or invalid DOCTYPE detected; syntax checker will assume "HTML 5".
Document type doesn't permit attribute "xmlns" within element "<html>".
Document type doesn't permit attribute "xml:lang" within element "<div>".
3. In addition, when I rezipped and sent the ePub to iBooks, the formatting I'd added wasn't there (though it had previewed perfectly in BBEdit and browsers).
4. I then replaced everything above the opening <head> element with the lines from a Pages-exported file. The error messages disappeared, but the formatting still wasn't there in iBooks.
As a near-novice, I can't figure out what's going on. Is there some kind of mismatch between XHTML and HTML?
For what it's worth, the formatting appeared correctly in iBooks when I replaced this line (which appeared immediately below the <head> element)
<div id="x03-Preparing.html" xml:lang="en-US">
with this one:
<div id="x15-Preparing.html" >
The language declaration was already made above. See whole section:
<?xml version="1.0" encoding="UTF-8"?>
PUBLIC "-//W3C//DTD XHTML 1.1//EN"
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<link href="template.css" rel="stylesheet" type="text/css" />
<div id="x03-Preparing.html" >… (etc.)
I remain puzzled about HTML vs. XHTML. Liz Castro says the ePub's content files should be in XHTML. Not true?
Without knowing anything else about this subject (): did you read Steve Werner's Creating EPUB in InDesign CS5.5: Beware the WebKit Bug!?
He describes an annoying CS5.5 ePub-related export error in declaring the proper DTD.