This specification, EPUB Multiple-Rendition Publications, defines the creation and rendering of EPUB® Publications consisting of more than one Rendition.

Introduction

Overview

The need to include more than one Rendition of an EPUB Publication has grown as Reading Systems have evolved and become more sophisticated. While some measure of content adaptation has always been possible at the style sheet level, it is both limited in what it can accomplish and limited to content rendering. Existing fallback mechanisms within the Package Document similarly only ensure that resources can be rendered.

Adaptation is not just about optimizing styling and positioning content for screen considerations, such as dimensions and color or Reading System orientation, but often involves changing the content itself. The resources and markup required to render a fixed-layout Rendition of an EPUB Publication may overlap with a reflowable version of the same, but the two are never exactly the same. Adaptation also involves adapting the prose of a work. In an increasingly interconnected world, including multiple translations of a work rather than bundling them all separately as single-language EPUB Publications is often a necessity. And adaptation is also about the ability to move from the same spot in one Rendition to the equivalent spot in another as changes in the reading environment occur.

This specification defines how a Reading System selects from multiple Author-provided Renditions of the content to best match the current device characteristics and user preferences — it does not define methods for modifying content on the fly. As changes occur to device orientation or the user's preferred reading modality, for example, the Reading System will be able to check for a better Rendition and seamlessly present it using the functionality defined herein.

The specification addresses each of the major requirements in the discovery of, selection of, and mapping between, multiple Renditions of an EPUB Publication. In particular:

Taken together, these features enable the creation of advanced Multiple-Rendition Publications that Reading Systems can adapt to changing user needs.

Background

The notion of including multiple renditions of an EPUB Publication has existed for as long as the EPUB standard, but the specification has never fully addressed what these renditions are for and how to access them. As a result, the EPUB 3 specification generally equates an EPUB Publication with a single rendering of the content. Moreover, most Authors and Reading System developers equate an EPUB Publication with a single Package Document referenced from the first rootfile element in the container.xml file [[EPUB-33]].

In practice, however, the container.xml file does not restrict Authors to listing only a single Package Document. In EPUB 2, for example, Authors could add additional rootfile elements referencing any other format they desired (e.g., another Package Document, a PDF file, or even a Word Document). In EPUB 3, rootfile elements were restricted to referencing only Package Documents of the same version of the standard.

This specification moves beyond merely allowing multiple renderings to define a more complete framework for identifying and selecting from among them. Each Package Document referenced from a rootfile element is defined to be one Rendition of the EPUB Publication, with the first Package Document representing the Default Rendition (i.e., the one that all Reading Systems have to process).

Although this model is intended to work as seamlessly as possible with existing the EPUB ecosystem, the authoring of multiple Renditions requires some compromises to maintain compatibility (e.g., some duplication of metadata will be necessary for Reading Systems that do not handle multiple renditions).

Relationship to EPUB 3

The method defined in this specification for including multiple Renditions within an EPUB Container is not required for all EPUB Publications. Multiple Renditions MAY be included in a Container without adhering to this specification, as the ability to create multiple-Rendition Containers pre-dates this specification.

It is strongly RECOMMENDED, however, that all future needs for multiple Renditions in a Container follow this specification. Existing implementations that utilize other methods for selecting from multiple Renditions are also encouraged to consider migrating to use this specification to improve the overall interoperability of Multiple-Rendition Publications.

Some of the Rendition selection attributes defined in this specification share common names with Package Document elements and properties [[EPUB-33]] as they are designed to reflect that information for selection purposes.

Despite this commonality, this specification does not enforce equivalence between the Rendition selection properties expressed on a rootfile element [[EPUB-33]] and the metadata expressed in the corresponding Package Document, as direct equivalence is not always possible.

For example, a multilingual EPUB Publication will define more than one DCMES language element [[EPUB-33]] — one for each language — but for Rendition selection only the primary language is defined. Likewise, the language defined in the Package Document could include a specific region code, but for selection purposes the Author might identify only the language code.

The reason for common metadata in both locations is to simplify the selection process: including attributes avoids the requirement to parse each referenced Package Document and allows for expressions of primacy that are not possible at the package level. It also avoids collisions and ambiguities between metadata being used for different purposes (selection versus rendering).

The selection properties defined in the container.xml file [[EPUB-33]] have no rendering behaviors attached to them, either. For example, indicating that a Rendition is fixed layout in the rendition:layout attribute does not trigger fixed layout rendering behaviors within the specified Rendition.

A Reading System renders a Rendition according to the metadata expressed in the Package Document only.

Terminology

The following terms used in this document are defined in [[EPUB-33]]:

In addition, this document defines the following terms:

Container Document

The container.xml file located in the child META-INF directory of the EPUB Container Root Directory [[EPUB-33]]. Each Rendition in the Container is identified by a rootfile element [[EPUB-33]].

Default Rendition

The Rendition listed in the first rootfile element in the container.xml file [[EPUB-33]].

Multiple-Rendition Publication

An EPUB Publication that consists of two or more Renditions of the content.

Rendition

One rendering of the content of an EPUB Publication, as expressed by a Package Document.

Rendition Mapping Document

A specialization of the XHTML Content Document, containing machine-readable mappings between equivalent content in different Renditions, conforming to the constraints expressed in Rendition Mapping.

Specifying Multiple Renditions

Each Rendition of an EPUB Publication MUST meet the requirements for EPUB Publications [[!EPUB-33]].

The Package Document for each Rendition MUST be listed in the container.xml file [[!EPUB-33]], where the first Package Document listed represents the Default Rendition.

Each Rendition of the EPUB Publication SHOULD only list the Publication Resources necessary for its rendering in its Package Document manifest [[!EPUB-33]]. Renditions MAY reference the same Publication Resources.

Expressing Metadata

Rendition Metadata

Metadata expressed at the Rendition level MAY change from instance to instance. For example, Renditions in different languages will have different primary languages and language-specific metadata such as titles will be expressed differently. Similarly, bundled fixed-layout and reflowbale Renditions will express different rendering metadata.

Publication Metadata

The metadata.xml File

To ensure consistency of metadata at the Publication and Rendition levels, this specification defines the content model of the root metadata element in the metadata.xml file [[EPUB-33]] to be the same as the Package Document metadata element [[EPUB-33]], with the following differences in syntax and semantics:

  • A dc:identifier element [[DCTERMS]] MUST contain the unique identifier [[EPUB-33]] for the EPUB Publication.
  • A meta element [[EPUB-33]] MUST contain the last modified date, expressed using the dcterms:modified property [[DCTERMS]]. The value of the property MUST conform to the pattern and rules defined in Last Modified Date [[EPUB-33]]. Only one dcterms:modified property without a refines attribute [[EPUB-33]] is allowed.
  • All other metadata is OPTIONAL.
  • The obsolete OPF2 meta element [[EPUB-33]] is not allowed.
  • The meta and link elements are defined in the same namespace as the metadata root element: http://www.idpf.org/2013/metadata
  • In order to enable the full expression of metadata in the metadata.xml file, all attributes allowed on the package element [[EPUB-33]] are allowed on the root metadata element.

This specification does not define a model for the inheritance of metadata from the Publication level to the Rendition level, as EPUB processing only requires that the Default Rendition be recognized by Reading Systems (i.e., reliance on inheritance could result in Reading Systems not locating necessary metadata).

Authors are strongly encouraged to include a complete set of Publication metadata in the Default Rendition to ensure cross-compatibility, even when making use of this file.

Titles, languages and other metadata is often not applicable from one Rendition to another, further complicating the sharing of metadata. No assumption can be made that metadata in the metadata.xml file is applicable to any given Rendition, whether the metadata is expressed in the Rendition or not.

As [[EPUB-33]] does not define a content model for the metadata.xml file, EPUB Publications that do not conform to this specification can include different metadata. EPUB Publications that are not valid to the schema in are not valid Multiple-Rendition Publications as defined by this specification, but might still be valid EPUB 3.0.1 Publications.

Authors are strongly encouraged to migrate to the content model defined in this specification, even if not producing Multiple-Rendition Publications, to ensure consistent processing.

Vocabulary Association Mechanisms

This specification inherits the mechanisms for associating vocabularies defined in Vocabulary Association Mechanisms [[EPUB-33]] as they relate to the Package Document metadata, with only the following modification: the prefix attribute MAY be attached only to the root metadata element.

Reserved prefixes [[EPUB-33]] for metadata attribute expressions are adopted without change.

Rendition Selection

Introduction

Although each EPUB Publication represents a single work, it is possible to optimize the rendering of that work in any number of different ways. An issue of a magazine, for example, could include a fixed layout version (print replica) for rendering on tablet-sized screens with a reflowable version for smaller cellphone screens where the fixed layout would be scaled to illegibility (or automatically reflowed in unwanted ways if fixed layouts are not supported).

The EPUB Container allows multiple Renditions of the content to be included in an EPUB Publication, but does not specify how Reading Systems are to determine the unique properties of the Renditions listed in the Container Document, or select between them.

This section redresses this problem by defining both a set of rendition selection attributes that can be attached to rootfile elements [[EPUB-33]] in the Container Document and a processing model that allows Authors to specify which Rendition is the best representation depending on various conditions. Reading Systems can then select the appropriate representation from the list of Renditions to match the current configuration and user preferences.

Content Conformance

A Container Document MUST meet all of the following criteria:

Reading System Conformance

An EPUB Reading System MUST meet all of the following criteria for Rendition selection:

Rendition Selection Attributes

The rendition:media attribute

The rendition:media attribute identifies the media features of a Reading System the given Rendition is best suitable for rendering on.

Attribute Name

media

Namespace

http://www.idpf.org/2013/rendition

Usage

MAY be specified on Container Document rootfile elements [[EPUB-33]].

Value

A CSS 3 media query [[MediaQueries]], where the media type, if specified, MUST only be the value "all".

As per [[MediaQueries]], the media query in this attribute MUST evaluate to true in order for the given Rendition to be selected for rendering. Media queries that evaluate to "not all” per 3.1 Error Handling [[MediaQueries]] SHOULD be treated as false for the purposes of Rendition selection (i.e., the given Rendition is not a valid match).

The rendition:layout attribute

The rendition:layout attribute indicates whether the given Rendition is reflowable or pre-paginated.

Attribute Name

layout

Namespace

http://www.idpf.org/2013/rendition

Usage

MAY be specified on Container Document rootfile elements [[EPUB-33]].

Value

The value of the attribute MUST be reflowable or pre-paginated.

When specified, the value of this attribute MUST match the global rendition:layout setting [[EPUB-33]] for the referenced Rendition.

If a user layout preference is defined in the Reading System, the attribute evaluates to true if the preference matches the specified value, otherwise it evaluates to false. If no user preference is defined, the Reading System SHOULD ignore the attribute when selecting from the available Renditions.

The rendition:language attribute

The rendition:language attribute indicates that the given Rendition is optimized for the specified language.

Attribute Name

language

Namespace

http://www.idpf.org/2013/rendition

Usage

MAY be specified on Container Document rootfile elements [[EPUB-33]].

Value

MUST contain a valid language code conforming to [[RFC5646]].

The rendition:language attribute more precisely identifies the primary language of a Rendition than does the inclusion of dc:language elements in the Rendition's Package Document, as the presence of dc:language elements only indicates that the specified languages are prominently used in the prose.

If a user language preference is defined in the Reading System, the attribute evaluates to true if the preference matches the specified value, otherwise it evaluates to false. Several matching schemes are defined in Section 3 of [[RFC4647]]. Reading systems can use the most appropriate matching scheme. If no user preference is defined, the Reading System SHOULD ignore the attribute when selecting from the available Renditions.

The rendition:accessMode attribute

The rendition:accessMode attribute identifies the way in which intellectual content is communicated in a Rendition, and is based on the [[ISO24751-3]] "Access Mode" property.

Attribute Name

accessMode

Namespace

http://www.idpf.org/2013/rendition

Usage

MAY be specified on Container Document rootfile elements [[EPUB-33]].

Value

MUST be one or more of the values: auditory, tactile, textual or visual

The rendition:accessMode attribute defines the primary access mode(s) for a given Rendition. For example, although a textual work may include images, audio and video, its primary means of conveying information is the text. Likewise, a visual work might include alternative text and/or descriptions, but these adaptations are not listed as a textual mode for the Rendition for the purpose of selection.

The way in which information is encoded also needs to be considered when designating an access mode. If a work has text components, or is completely textual in nature, but that content is burned into an image format, the access mode is visual (e.g., character dialogue in a JPEG page of a comic or a scan of a document).

A Rendition MAY include more than one primary access mode. For example, the textual version might also embed the auditory version using media overlays. In such cases, the attribute should list each primary access mode that is available.

If a user access mode preference is defined in the Reading System, the attribute evaluates to true if that preference matches any of the access modes defined in it, otherwise it evaluates to false. If no user preference is defined, the Reading System SHOULD ignore the attribute when selecting from the available Renditions.

The rendition:label attribute can be use to inform users about the nature of the content, particularly where such information is not available, or not yet standardized, for selection. For example, a tactile rendition could indicate the braille code and grade in its label, or a textual rendition could be marked as optimized for text-to-speech rendering, not general use.

The rendition:label attribute

The rendition:label attribute allows each rootfile element [[EPUB-33]] to be annotated with a human-readable name.

Attribute Name

label

Namespace

http://www.idpf.org/2013/rendition

Usage

MAY be specified on Container Document rootfile elements [[EPUB-33]].

Value

Text.

The rendition:label attribute provides a name for the given Rendition (e.g., for manual Rendition selection).

The language of the rendition:label attribute MAY be expressed in an xml:lang attribute.

The rendition:label attribute is not a selection attribute for the purposes of evaluating which Rendition to render.

Processing Model

This section describes the method by which Reading Systems locate the optimal Rendition to present to a user.

Rendition selection SHOULD occur on initial rendering, and Reading Systems SHOULD re-evaluate the selection in response to changes in the user environment (e.g., change in device orientation or viewport size).

When a change condition is triggered, the Reading System SHOULD evaluate the rootfile elements [[EPUB-33]] in the Container Document as follows, starting with the last rootfile entry:

If the Default Rendition is reached, select that Rendition and exit the process.

This processing model does not require that the selection process occur on a user's device, or that all Renditions be provided in the Container. Rendition selection could occur on the server side of a cloud-based delivery system, for example, and only a single best-match Rendition sent to the device.

Since EPUB 2 Reading Systems, and EPUB 3 Reading Systems that do not support multiple-Rendition selection, will render the Default Rendition, Authors need to consider which Rendition will have the greatest compatibility across Reading Systems and ensure it is listed first.

A Reading System MAY provide the user the option to manually select any of the Renditions in the Container. It SHOULD use the rendition:label attribute attribute value to present the option, when available.

As EPUB did not previously define a Rendition selection model, custom selection models might be encountered in some EPUB Publications. When recognized, these selection models SHOULD be utilized. If both rendition selection attributes conformant to this specification and custom attributes are defined, the latter SHOULD be ignored.

Rendition Mapping

Introduction

The Rendition Mapping Document identifies related content locations across the Renditions in a Multiple-Rendition Publication, allowing Reading Systems to switch between Renditions while keeping the user's place.

The Rendition Mapping Document is represented as XHTML, and uses nav elements with unordered lists to group the mappings. There is no display component to the Rendition Mapping Document; it is designed to enable automated switching. The lack of a rendering context means that the XHTML content model for this document is very restrictive, allowing only a single nav element in the body, to ease both authoring and processing.

To enable the mapping of content locations between Renditions, the Rendition Mapping Document's nav element consists of a series of one or more unordered lists, each of which represents a common point across all the Renditions (e.g., a chapter, a page or a component within a page). The list items in each unordered list represent the set of equivalent link destinations across the available Renditions for that content (e.g., one link might point to a document representing one page of a fixed layout Rendition, while the equivalent link to a reflowable Rendition might point to the corresponding page break indicator within the XHTML Content Document containing the page).

Knowing the position of the user in the current Rendition, when a change in context occurs, or is triggered by the user, the Reading System can inspect the sibling list items to determine the EPUB Content Document to load that best meets the new conditions.

Content Conformance

An EPUB Publication MAY include an EPUB Rendition Mapping Document.

A conformant EPUB Rendition Mapping Document MUST meet all of the following criteria:

Document Properties

Publication

Reading System Conformance

Reading Systems SHOULD support the use of Rendition Mapping Documents to switch between content.

If a Reading System supports mapping, it MUST meet all of the following criteria:

EPUB Rendition Mapping Document Definition

XHTML Content Document: Restrictions

The Rendition Mapping Document is a compliant XHTML Content Document, but with the following restrictions on the [[HTML]] content model:

  • No attributes are allowed on the html, head, body, ul and li elements. (The xmlns pseudo-attribute for namespace declarations is allowed.) The nav element only accepts an epub:type attribute.
  • The head MAY contain only meta elements. Only the charset attribute or name and content attributes MAY be attached to the meta elements.
  • The head MUST include a meta element whose name attribute has the value "epub.multiple.renditions.version" and whose content attribute has the value "1.0". Reading Systems MAY ignore all other meta elements.
  • The body element MUST include exactly one nav element child whose epub:type attribute specifies the value "resource-map", and MAY include one or more optional nav elements. No other [[HTML]] content is allowed as a child of the body.

The nav Element: Modifications and Restrictions

This specification restricts the content model of nav elements and their descendants in the Rendition Mapping Document as follows:

  • Each nav element MUST identify its nature in an epub:type attribute.
  • The Rendition Mapping Documents uses unordered lists (ul) in place of ordered lists (ol).
  • The nav element MAY contain one or more ul element.
  • Each list item (li) MUST contain exactly one a element (i.e., span headings and nested lists are forbidden).
  • a elements MUST be empty.
  • The a element MUST specify the rendition it is referring to either:

    • by using an Intra-Publication CFI as the value of the href attribute or,
    • by having an epub:rendition attribute whose value is the relative path to the Publication Document for the rendition.

Rendition Mappings

Each ul element in the Rendition Mapping Document resource-map nav element identifies a content location, listing in its child li elements where that location is found in each of the available Renditions. Consequently, each ul element MUST contain an li for each Rendition.

In order to allow a broad variety of use cases, this specification does not impose any particular level of mapping granularity. For example, some publications aimed at language learners may define sentence-level synchronisation points, whereas other types of publications may only map major sections across Renditions.

Each list item in the unordered list MUST identify an EPUB Content Document, or a fragment therein, for one of the Renditions ‒ defined in a child a element. Each of these links MUST reference a linear Top-level Content Document [[EPUB-33]].

Each a element MUST specify which Rendition it refers to either 1) by including an Intra-Publication CFI [[EPUBCFI-11]] in its href attribute, or 2) by providing the relative path to the Package Document for the Rendition as the value of an epub:rendition attribute.

If the epub:rendition attribute is used to specify the target Rendition, any fragment identifier scheme MAY be used within the URI value of the href attribute of a elements (e.g., unique identifier, or W3C Media Fragment).

The use of [[EPUBCFI-11]] expressions is strongly encouraged over other fragment identifier schemes (particularly in the context of reflowable XHTML Content Documents), as they allow Reading Systems to ingest Rendition Mappings without any prior pre-processing. Conversely, the use of unique identifiers forces Reading Systems to load the targeted Content Documents and process their DOM in order to sort/compare the link destinations (in relation to document order). This additional processing has performance implications, and implementation costs in terms of caching, incremental updating, etc.

Examples

Container Identification

The location of the Rendition Mapping Document is identified in the Container Document using an [[EPUB-33]] link element child of the root container element, where:

  • the href attribute MUST reference the location of the Rendition Mapping Document relative to the root of the EPUB Container;
  • the rel attribute MUST specify the value "mapping";
  • the media-type attribute MUST specify the value "application/xhtml+xml".

The Container Document MUST NOT reference more than one mapping document.

Processing Model

This section provides an informative model by which the Rendition Mapping Document could be processed by a Reading System. It does not address how or when a Reading System should switch Renditions.

The desired outcome of the Rendition Mapping Document's mapping capabilities is to display content in the new Rendition that is equivalent to their location in the current Rendition, so that a user maintains their place during reading. To accomplish this goal, a compliant Reading System could follow these steps to reset the current Rendition when a change condition is triggered:

Note that what happens during navigation is largely a user experience issue, so a Reading System might choose to consider additional information than above to try to achieve a better outcome.

Schemas

Validation using the schemas in this appendix requires a processor that supports [[RELAXNG-SCHEMA]] and [[XMLSCHEMA11-2]].

Metadata.xml Schema

The schema for including metadata in the metadata.xml file, as described in , is available at http://www.idpf.org/epub/renditions/multiple/schema/mr-metadata.rnc.

Container.xml Schema

The schema for including rendition selection attributes in the container.xml file, as described in , is available at http://www.idpf.org/epub/renditions/multiple/schema/mr-container.rnc.

Mapping Document Schema

The schema for Mapping Documents, as described in , is available at http://www.idpf.org/epub/renditions/multiple/schema/epub-rendition-mapping.rnc.

Change Log

Note that this change log only identifies substantive changes — those that affect the conformance of EPUB Publications or are similarly noteworthy.

For a list of all issues addressed during the revision, refer to the working group's issue tracker.

Substantive changes since EPUB Multiple-Rendition Publications 1.0