<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>epubBlog &#187; OPF</title>
	<atom:link href="http://blog.epubbooks.com/tag/opf/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.epubbooks.com</link>
	<description>epubBlog: EPUB eBook Help &#38; Resources</description>
	<lastBuildDate>Tue, 15 May 2012 08:49:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Bookworm will not reject valid ePub &#8211; but are you valid?</title>
		<link>http://blog.epubbooks.com/238/bookworm-will-not-reject-valid-epub-but-are-you-valid</link>
		<comments>http://blog.epubbooks.com/238/bookworm-will-not-reject-valid-epub-but-are-you-valid#comments</comments>
		<pubDate>Wed, 08 Oct 2008 21:54:51 +0000</pubDate>
		<dc:creator>Mike Cook</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Bookworm]]></category>
		<category><![CDATA[NCX]]></category>
		<category><![CDATA[OPF]]></category>
		<category><![CDATA[Threepress]]></category>

		<guid isPermaLink="false">http://www.epubbooks.com/blog/?p=238</guid>
		<description><![CDATA[Liza Daly from threepress.org has just released an article outlining problems she is having with users uploading invalid ePub formatted documents to Bookworm; an online ePub book reader. It&#8217;s very important for anyone developing ePub eBooks to produce valid markup. Not only will Bookworm give desirable results when rendering, but you&#8217;ll also be covering yourself [...]]]></description>
			<content:encoded><![CDATA[<p><a class="post_image_link" href="http://blog.epubbooks.com/238/bookworm-will-not-reject-valid-epub-but-are-you-valid" title="Permanent link to Bookworm will not reject valid ePub &#8211; but are you valid?"><img class="post_image alignleft" src="http://blog.epubbooks.com/images/bookworm-logo.png" width="181" height="66" alt="Bookworm Logo" /></a>
</p><p>Liza Daly from threepress.org has just released an article outlining problems she is having with users uploading invalid ePub formatted documents to <a title="Bookworm: An online ePub Book Reader" href="http://bookworm.threepress.org">Bookworm; an online ePub book reader</a>. It&#8217;s very important for anyone developing ePub eBooks to produce valid markup. Not only will Bookworm give desirable results when rendering, but you&#8217;ll also be covering yourself for any future rendering engines and conversions you might need to do.</p>
<p>It&#8217;s actually quite surprising how many errors are showing up from files submitted to Bookworm. You should go over to the <a title="Valid ePub's at threepress.org" href="http://blog.threepress.org/2008/10/08/how-good-are-your-epubs/">threepress blog</a> for a full explanation, but here&#8217;s a list of the main errors;</p>
<ol>
<li>Missing required attributes in the metadata</li>
<li>Metadata that hasn’t been proofread</li>
<li>Improper nesting of the ePub zip file</li>
<li>Items declared in the OPF file that are missing from the archive</li>
<li>Invalid XHTML</li>
</ol>
<p>Points 1 to 4 are really quite vital, although it is understanable for many documents to have invalid XHTML. Still, if it is within your means, I would try to control this the best you can.</p>
<p>I have plans to write some detailed articles regarding the creation of both the NCX and OPF files found in an ePub document, so keep a lookout for those.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.epubbooks.com/238/bookworm-will-not-reject-valid-epub-but-are-you-valid/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Creating an ePub document from XHTML</title>
		<link>http://blog.epubbooks.com/183/creating-an-epub-document</link>
		<comments>http://blog.epubbooks.com/183/creating-an-epub-document#comments</comments>
		<pubDate>Thu, 25 Sep 2008 22:10:55 +0000</pubDate>
		<dc:creator>Mike Cook</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[EPUB]]></category>
		<category><![CDATA[epubcheck]]></category>
		<category><![CDATA[IDPF]]></category>
		<category><![CDATA[NCX]]></category>
		<category><![CDATA[OCF]]></category>
		<category><![CDATA[OPF]]></category>
		<category><![CDATA[OPS]]></category>

		<guid isPermaLink="false">http://www.epubbooks.com/blog/?p=183</guid>
		<description><![CDATA[In my last post I talked about the epubBooks Project and how I plan to convert Project Gutenberg .txt eBooks to the ePub format and how I will make these eBooks available for download from ePubBooks.com. I already have in place a converter to transform the PG .txt files to a TEI Master Format and [...]]]></description>
			<content:encoded><![CDATA[<p><a class="post_image_link" href="http://blog.epubbooks.com/183/creating-an-epub-document" title="Permanent link to Creating an ePub document from XHTML"><img class="post_image alignleft" src="http://blog.epubbooks.com/images/epub-logo.png" width="108" height="51" alt="epubBooks" /></a>
</p><p>In my last post I talked about the <a title="The epubBooks Project announcement" href="/161/the-epub-books-project-part-1-an-introduction">epubBooks Project</a> and how I plan to convert Project Gutenberg .txt eBooks to the ePub format and how I will make these eBooks available for download from ePubBooks.com.</p>
<p>I already have in place a converter to transform the PG .txt files to a TEI Master Format and also an XSLT script to convert these into XHTML. The final task now is to create a converter for TEI to the ePub format.</p>
<p>Before I attempt to write this converter I will need to have a much better understanding on how a book is laid out inside the ePub OEBPS Container Format (OCF) .zip archive. So I set about taking my XHTML output file and breaking it up into the appropriate parts ready to be packaged in to an .epub file.</p>
<p>On the whole this went fairly smoothly, although I did encounter a couple of issues, which I&#8217;ll explain at the end of this article.</p>
<p><span id="more-183"></span>A great way to understand how to make your own ePub Book is to download and examine a pre-existing book. My reference book was <a title="Jon Noring's ePub version of My Antonia" href="http://www.idpf.org/forums/viewtopic.php?t=59&amp;sid=b8f0598930a8e23bdcf554918ad9f917">Jon Noring&#8217;s submission of &#8220;My Ántonia&#8221; by Willa Cather</a>, found on the IDPF website.</p>
<p>After unzipping and examining the contents everything looked straight forward, so went ahead and started editing Jon&#8217;s file into my own.</p>
<h4>OPS</h4>
<p>My first task was to split up the all-in-one XHTML file into separate chapters, title page, footnotes, etc., thus creating the OPS files. During this I added the appropriate header and footer (using My Ántonia as the guide), making sure I also included the correct link to the CSS file and giving each its own title.</p>
<p>As XHTML 1.1 can be used directly within an ePub document there was nothing to change within the text itself.</p>
<h4>OPF</h4>
<p>Once I had all my separate OPS parts I went ahead and started editing the ePub OPF file.</p>
<p>Again using Jon&#8217;s example as a guide, I entered all the book information (Title, Author, etc..) into the meta tags &#8211; an important tag to note is the <code>dc:identifier</code>. For this you will need to create a unique identifier for the book/document. You can use anything you like here (including an ISBN number) as long as it is completely unique. As this is just a test file I used the epubbooks.com domain name, the date and the time. (This ID will also be used in the NCX file.)</p>
<p>Once I was happy with the data I went on to the <code>manifest</code> section and listed all the files used in the publication<code>; </code>cover, title page, introduction, chapters, footnotes, CSS Style Sheets, images and finally the NCX file.</p>
<p>The <code>spine</code> section lists the reading order for the book and was pretty straight forward.</p>
<h4>NCX</h4>
<p>Next I edited the NCX (Navigation Center eXtended) file. This provides the <em>Reading System</em> with the TOC listing and navigation links. Each entry is given an ID, PlayOrder, Label and filename. ID&#8217;s should always be unique and the &#8216;PlayOrder&#8217; starts at &#8220;1&#8243; with no gaps in the sequence.</p>
<p>There are couple of important points to take note on here. The &#8216;Unique ID&#8217; created in the OPF file (<code>dc:identifier</code>) needs to be included in this <code>meta</code> section. You will also need to adjust the <code>&lt;meta name="dtb:depth" content="1"/&gt;</code> value.</p>
<p>If you have an eBook with just chapters then the depth will be &#8220;1&#8243;. If you have an eBook that has Books, Chapters and Sections, then <strong>Book is Level 1</strong>, <strong>Chapters are Level 2</strong> and <strong>Sections are Level 3</strong>. The more sections you have within your TOC the more &#8216;depths&#8217; you will need to state.</p>
<h4>Footnotes</h4>
<p>All the final editing needed was to set up links for the footnotes. As I&#8217;m storing the footnotes in a separate file I marked up the entry in the <code>spine</code> with <code>linear="no"</code> as this should be considered an &#8220;auxiliary&#8221; file.</p>
<p>Now all that was needed was to add the filename to the <code>a</code> tag in the <code>footnotes.xml</code> file, which in this case became <code>chapter001.xml#fn-place-1</code> and In the <code>chapter001.xml</code> file I added a link to the footnote file, <code>footnotes.xml#fn-1.</code></p>
<h4>Creating the .epub file</h4>
<p>There&#8217;s a couple of rules to follow when creating your .zip (ePub) file.</p>
<ul>
<li><code>mimetype</code> must be the first file in the .zip</li>
<li>No compression is to be used on this file.</li>
</ul>
<p>Once you have this file in place then you can then go ahead and add the rest of the content, just make sure you retain the directory structure.</p>
<h4>Problems and further research</h4>
<p>One thing to remember is that filenames are case sensitive. Make sure you use the same case as stated in your OPF and NCX files, otherwise they will not be displayed.</p>
<p>When I created my XHTML version I had each TOC entry linking to the appropriate chapter, if you clicked on the chapter heading you would be transported back to the TOC entry. When using DE on my desktop computer there did not seem to be a need to use linking back to the TOC, but until I get myself a Sony Reader or BeBook I won&#8217;t be able to test exactly how this works on a dedicated reader.</p>
<h4>epubcheck</h4>
<p>Although my .epub eBook displays perfectly well in Adobe DE, it does however fail on many points when tested against the epubcheck tool. Most of these seem related to undeclared entities (<code>ndash</code>) and some undefined <code>fragment identifier</code>s. I guess I&#8217;ll just need to get stuck into the specifications and see where I&#8217;m going wrong &#8211; I don&#8217;t think these are going to be major issues though.</p>
<p>I hope article has provided a nice overview on creating an ePub eBook. I still need to clean up these epubcheck errors but once that&#8217;s done I can get on with writing the XSLT conversion script. I will likely do a follow up article covering what was need to validate against epubcheck and I will try and write some more detailed articles on creating both the OPF and NCX files.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.epubbooks.com/183/creating-an-epub-document/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

