{"id":2112,"date":"2010-04-06T17:04:00","date_gmt":"2010-04-06T22:04:00","guid":{"rendered":""},"modified":"2020-03-27T21:20:47","modified_gmt":"2020-03-28T02:20:47","slug":"getting-into-apple-bookstore-with-epub","status":"publish","type":"post","link":"https:\/\/henrymelton.net\/2\/2010\/04\/06\/getting-into-apple-bookstore-with-epub\/","title":{"rendered":"Getting into the Apple Bookstore with ePub 1.0.5"},"content":{"rendered":"<div class=\"separator\" style=\"clear: both; text-align: center;\"><a href=\"http:\/\/2.bp.blogspot.com\/_F_I2jb9dIrA\/S7tbcU5X7gI\/AAAAAAAAAyA\/PuGzoWOzdSE\/s1600\/overview_ibooks_20100403.jpg\" imageanchor=\"1\" style=\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"><img decoding=\"async\" loading=\"lazy\" border=\"0\" height=\"200\" src=\"https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2010\/04\/overview_ibooks_20100403.jpg\" width=\"144\" \/><\/a><\/div>\n<p>The first thing that caught my notice when the iPad was first announced was that they would have a bookstore. &nbsp;The second thing that was clear, after lots of research, was that there was no easy way for a tiny publisher like me to talk to the Apple people. &nbsp;I monitored the publishing news and sure enough, there&#8217;s a new word out there\u2013&#8221;Aggregators&#8221;. <\/p>\n<p>Apple has contracts with Lulu, Ingram, LibreDigital, and perhaps others to serve as aggregators of small publishers and self publishers. &nbsp;I&#8217;ve been looking at the details and the first thing that stands out is the tougher standards required for the ePub files. &nbsp;You see there are ePub books that work, but there are also ePub books that pass the 1.0.5 standard validators. &nbsp;Only the latter need apply.<\/p>\n<p>So&#8230;I found the validator at&nbsp;<a href=\"http:\/\/code.google.com\/p\/epubcheck\/\">http:\/\/code.google.com\/p\/epubcheck\/<\/a> where it&#8217;s a free download. &nbsp;The program is java, so it&#8217;s fairly portable. &nbsp;It&#8217;s easy to run in a terminal session:<\/p>\n<p>\n<span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace;\">hjmmbp:epubcheck-1.0.5 hmelton$ java -jar epubcheck-1.0.5.jar&nbsp;\/Users\/hmelton\/Desktop\/GoldenGirl.epub&nbsp;<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace;\">Epubcheck Version 1.0.5<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace;\"><br \/>\n<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace;\">ERROR: \/Users\/hmelton\/Desktop\/GoldenGirl.epub\/OEBPS\/text\/content004.xhtml(15): attribute &#8220;name&#8221; not allowed at this point; ignored<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace;\">ERROR: \/Users\/hmelton\/Desktop\/GoldenGirl.epub\/OEBPS\/text\/content004.xhtml(17): attribute &#8220;name&#8221; not allowed at this point; ignored<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace;\">ERROR: \/Users\/hmelton\/Desktop\/GoldenGirl.epub\/OEBPS\/text\/content005.xhtml(13): attribute &#8220;name&#8221; not allowed at this point; ignored<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace;\">ERROR: \/Users\/hmelton\/Desktop\/GoldenGirl.epub\/OEBPS\/text\/content006.xhtml(13): attribute &#8220;name&#8221; not allow<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace;\"><br \/>\n<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\">I was horrified to see that my lovely ePub files weren&#8217;t validated. &nbsp;Actually, there was one that passed. &nbsp;But the others needed minor work. &nbsp;Tedious minor work. &nbsp;I had created my books using various work-flows. &nbsp;I had used Dreamweaver to do the HTML markup. &nbsp;I had exported ePub from InDesign CS4. &nbsp;I had converted some from mobi format using Calibre. &nbsp;And most of them had been through Sigil for various touch-up fixes\u2013and been subjected to Sigil&#8217;s built-in <\/span><span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace;\">tidy<\/span><span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\"> which modifies the code. &nbsp;The end result was code that worked, but code that didn&#8217;t pass the validator.<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\"><br \/>\n<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\">Now, I didn&#8217;t actually need to download and run my own copy of epubcheck since the nice people at Three Press Consulting run a <a href=\"http:\/\/threepress.org\/document\/epub-validate\/\">web version<\/a> of the same software where you can upload you files and test them. &nbsp;I wanted my own version so I could run it faster and with less net traffic and command line software doesn&#8217;t bother me, but your tastes may vary.<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\"><br \/>\n<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\">Once I discovered the errors, there comes the difficulty of fixing them. &nbsp;Sigil failed me. &nbsp;I would open the ePub file, correct the offending code, save the file and retest\u2013and discover that the error was still there. &nbsp;Either I was making some kind of cockpit error, or Sigil was &#8216;fixing&#8217; by code by putting back the elements I was removing. &nbsp;<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\"><br \/>\n<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\">I decided to go back to my roots. &nbsp;You can &#8216;explode&#8217; an ePub file with the command:<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\"><br \/>\n<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace;\">unzip -d work FallingBakward.epub<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\"><br \/>\n<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\">Then in work\/OEBPS\/text there are numerous files that contain the xhtml code of the book. &nbsp;I dropped into vi and went to work. &nbsp;Any text editor would probably work, but I was feeling very command line oriented, so vi with all it&#8217;s handy shortcuts was my choice for the day. &nbsp;Using the error codes from epubcheck points you right to the problem: &nbsp;<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\"><span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace;\">ERROR: \/Users\/hmelton\/Desktop\/GoldenGirl.epub\/OEBPS\/text\/content004.xhtml(15): attribute &#8220;name&#8221; not allowed at this point; ignored<\/span><\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\">This says that in the file content004.xhtml, on line 15, there is an extraneous name attribute. &nbsp;A few keystrokes, and it&#8217;s gone.<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\"><br \/>\n<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\">Repeat for every error line.<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\"><br \/>\n<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\">Now comes the process of putting the ePub file back together. &nbsp;Google took me to a nice comment on the process at&nbsp;<a href=\"http:\/\/instantindesign.com\/index.php?view=412\">http:\/\/instantindesign.com\/index.php?view=412<\/a> where the magic sequence is:<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\"><br \/>\n<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace;\">cd work<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\"><\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\"><span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace;\">zip file.epub -X0D mimetype<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace;\">zip file.epub -X9rD OEBPS<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace;\">zip file.epub -X9rD META-INF\/<\/span><\/p>\n<div>\n<\/div>\n<div>Now you have file.epub which you can run through the epubcheck validator again and see if any additional errors have popped up. &nbsp;Repeat until it&#8217;s clean. &nbsp;<\/div>\n<div>\n<\/div>\n<div>If you have any plans for putting your ePub files into Apple&#8217;s bookstore, you&#8217;d better get your files validated and ready. &nbsp;Good luck.<\/div>\n<p><\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: Times, 'Times New Roman', serif;\"><br \/>\n<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The first thing that caught my notice when the iPad was first announced was that they would have a bookstore. &nbsp;The second thing that was clear, after lots of research, was that there was no easy way for a tiny publisher like me to talk to the Apple people. &nbsp;I monitored the publishing news and&hellip; <a class=\"more-link\" href=\"https:\/\/henrymelton.net\/2\/2010\/04\/06\/getting-into-apple-bookstore-with-epub\/\">Continue reading <span class=\"screen-reader-text\">Getting into the Apple Bookstore with ePub 1.0.5<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":2113,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[1],"tags":[160,120,24],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2010\/04\/overview_ibooks_20100403.jpg","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4t90x-y4","_links":{"self":[{"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/posts\/2112"}],"collection":[{"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/comments?post=2112"}],"version-history":[{"count":1,"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/posts\/2112\/revisions"}],"predecessor-version":[{"id":2114,"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/posts\/2112\/revisions\/2114"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/media\/2113"}],"wp:attachment":[{"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/media?parent=2112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/categories?post=2112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/tags?post=2112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}