Multiple root files

229 views
Skip to first unread message

Torkild U. Resheim

unread,
May 12, 2012, 1:54:56 PM5/12/12
to epub...@googlegroups.com

I gather from the OCF 2 specification that it is perfectly legal to add multiple root files to one EPUB. The specification mentions only different renditions (as in formats) of a publication, for instance OEBPS and PDF. However I decided to see if I can create an EPUB with the same publication in different languages. This using the Eclipse EPUB tools. The resulting container.xml looks like this:


<?xml version="1.0" encoding="UTF-8"?>

<container xmlns="urn:oasis:names:tc:opendocument:xmlns:container" version="1.0">

  <rootfiles>

    <rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml"/>

    <rootfile full-path="OEBPS_1/content.opf" media-type="application/oebps-package+xml"/>

    <rootfile full-path="OEBPS_2/content.opf" media-type="application/oebps-package+xml"/>

  </rootfiles>

</container>


And the file layout:


.

├── META-INF

│   └── container.xml

├── OEBPS

│   ├── content.opf

│   ├── halfdan_svarte_en.xhtml

│   └── toc.ncx

├── OEBPS_1

│   ├── content.opf

│   ├── halfdan_svarte_no.xhtml

│   └── toc.ncx

├── OEBPS_2

│   ├── content.opf

│   ├── halfdan_svarte_is.xhtml

│   └── toc.ncx

└── mimetype


However when using ebubcheck (the latest build) I get these errors:


Validating against EPUB version 2.0

WARNING: Halfdan.epub: item (OEBPS_1/toc.ncx) exists in the zip file, but is not declared in the OPF file

WARNING: Halfdan.epub: item (OEBPS/toc.ncx) exists in the zip file, but is not declared in the OPF file

WARNING: Halfdan.epub: item (OEBPS_1/halfdan_svarte_no.xhtml) exists in the zip file, but is not declared in the OPF file

WARNING: Halfdan.epub: item (OEBPS/halfdan_svarte_en.xhtml) exists in the zip file, but is not declared in the OPF file


It appears that epubcheck only cares about the last content.opf. Incidentally so does iBooks on iPad. So, I'm wondering if what I'm trying to do is at all legal. If that is the case, I guess there is a bug in epubcheck and a missing feature in iPad.

Best regards,
Torkild

Markus Gylling

unread,
May 14, 2012, 6:08:53 AM5/14/12
to epub...@googlegroups.com
Hi Torkild,
as for the warnings you get in EPUBCheck, this is a bug (and I've added it at http://code.google.com/p/epubcheck/issues/detail?id=177).

As for the type of publication you are creating: first and as you have surely noticed, while adding multiple rootfiles is allowed, it is also unspecified how Reading Systems should deal with this, primarily since there is no explicit metadata mechanism to express how the renditions are distinguished from each other.  At this point in time (for both EPUB 2 and 3), Reading Systems are only required to -- and most if not all of them do nothing but -- render the first rendition (for the 3.0 language see [1], which IIRC is not changed fundamentally from 2.0).

There is an EPUB WG project underway to specify the behaviors of multiple renditions better. Once finalized, this project will most likely result in the definition of the declarative metadata mechanisms needed to target the kind of use case that you have.

Second, there is the long-running bibliographical debate of what constitutes a Publication and what constitutes a Rendition. I won't go into details here, suffice to say that most publishers today that publish multilingual content consider these to be separate publications, i.e provide these as separate EPUB files.  As said, this might change in the future, but at this point in time and if you are targeting off-the-shelf EPUB Reading Systems, you are unlikely to be able to achieve the results you are after.

Hope this helps! 




--
You received this message because you are subscribed to the Google Groups "epubcheck" group.
To view this discussion on the web visit https://groups.google.com/d/msg/epubcheck/-/orL6f_R4_GQJ.
To post to this group, send email to epub...@googlegroups.com.
To unsubscribe from this group, send email to epubcheck+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/epubcheck?hl=en.

Torkild U. Resheim

unread,
May 14, 2012, 1:56:29 PM5/14/12
to epub...@googlegroups.com
Hi Markus,

Thank you for a thorough and well written explanation! It sure helped. I suspected that most reading systems would have problems with this – but I figured it would be worthwhile to give it a try. As you have guessed, current reading systems are the target so I'll leave any further efforts for later.

Best regards,
Torkild 
Reply all
Reply to author
Forward
0 new messages