HT4168: Creating ePub files with Pages

Learn about Creating ePub files with Pages
paulmenken

Q: pages epub export

I encounter a problem when exporting an epub file from Pages after the latest update in december.

 

Epubcheck Version 1.2


ERROR: sagarra-priveleven.epub/OPS/cover.xhtml(5): element "div" not allowed here; expected the element end-tag, text or element "a", "abbr", "acronym", "applet", "b", "bdo", "big", "br", "cite", "code", "del", "dfn", "em", "i", "iframe", "img", "ins", "kbd", "map", "noscript", "ns:svg", "object", "q", "samp", "script", "small", "span", "strong", "sub", "sup", "tt" or "var" (with xmlns:ns="http://www.w3.org/2000/svg")


Check finished with warnings or errors!

 

The file does not pass the Epubchecker

 


 


Pages, OS X Mountain Lion (10.8.2)

Posted on Dec 7, 2012 12:56 AM

Close

Q: pages epub export

  • All replies
  • Helpful answers

  • by BoBennett,

    BoBennett BoBennett Dec 12, 2012 7:07 AM in response to paulmenken
    Level 1 (5 points)
    Dec 12, 2012 7:07 AM in response to paulmenken

    I have the same problem.  It looks as if Apple's export is simply creating invalid epubs that do not meet the 3.0 standards.

  • by BoBennett,

    BoBennett BoBennett Dec 12, 2012 7:21 AM in response to paulmenken
    Level 1 (5 points)
    Dec 12, 2012 7:21 AM in response to paulmenken

    You can fix this manually if you know how to edit an epub (unzip, edit, then rezip).  Change all the "div" tags surrpounding the images to "span" tags.  This will make it pass validation and still look the same.  Of course, this is a PIA work around.  Hope someone from Apple address this soon.

  • by jeffs44,

    jeffs44 jeffs44 Dec 28, 2012 10:49 PM in response to paulmenken
    Level 1 (0 points)
    Dec 28, 2012 10:49 PM in response to paulmenken

    Hi There,

     

    I also came across this issue. My epub files created by Pages always used to validate perfectly with epubcheck3.0.

     

    As I am about to publish I had a quick check this morning...horror! dozens of error messages such as these:

    "ERROR: cyw.epub/OPS/chapter-23.xhtml(5,4451): element "div" not allowed here; expected the element end-tag, text or element "a", "abbr", "acronym", "applet", "b", "bdo", "big", "br", "cite", "code", "del", "dfn", "em", "i", "iframe", "img", "ins", "kbd", "map", "noscript", "ns:svg", "object", "q", "samp", "script", "small", "span", "strong", "sub", "sup", "tt" or "var" (with xmlns:ns="http://www.w3.org/2000/svg")"

     

    It seems this fixes it:

    1- Open your epub using the free Sigil epub editor

    2- Save it with Sigil

     

    Rerun epubcheck validation! It indeed passed validation after this simple process.

     

    Hope it helps with you took.

     

    Take care

     

    Jeff

  • by MarkWilx,

    MarkWilx MarkWilx Oct 3, 2013 9:57 AM in response to BoBennett
    Level 1 (13 points)
    Wireless
    Oct 3, 2013 9:57 AM in response to BoBennett

    Howdy All:

     

    I thought I'd pipe in with my experiences for others finding this thread.  BoBennett, I tried your fix, but it did not work.  I replaced all occurances of "div" with "span" as you suggested.  This did not work.  I got following error:

     

    element "span" not allowed here; expected element "address", "blockquote", "del", "div", "dl", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "ins", "noscript", "ns:svg", "ol", "p", "pre", "script", "table" or "ul" (with xmlns:ns="http://www.w3.org/2000/svg")

     

     

    I also tried your solution jeffs44.  It didn't work either.  After doing as you suggested, I got the following error:

     

    element "metadata" incomplete; missing required elements "dc:language" and "dc:title"

     

    So, unfortunately, neither of these solutions work.  I expect changes were made somewhere that made the once valid solutions now invalid.  Really frustrated with Pages.

     

    Mark

  • by MarkWilx,

    MarkWilx MarkWilx Oct 3, 2013 10:22 AM in response to MarkWilx
    Level 1 (13 points)
    Wireless
    Oct 3, 2013 10:22 AM in response to MarkWilx

    I finally managed to get a clean ePub document export from Pages.  The solution I found was to open my Pages exported ePub file in Sigil, as jeffs44 suggested and then manually add the "dc:langauge" and "dc:title" metadata.  Then I save the file and got a clean epubcheck.

     

    Mark