Copyright © 2015-2022 W3C® (MIT, ERCIM, Keio, Beihang). W3C liability, trademark and permissive document license rules apply.
This specification, EPUB Multiple-Rendition Publications, defines the creation and rendering of EPUB® Publications consisting of more than one Rendition.
This section describes the status of this document at the time of its publication. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.
This document was published by the EPUB 3 Working Group as a Group Note using the Note track.
Group Notes are not endorsed by W3C nor its Members.
This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
The W3C Patent Policy does not carry any licensing requirements or commitments on this document.
This document is governed by the 2 November 2021 W3C Process Document.
This section is non-normative.
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 EPUB Creator-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:
META-INF/metadata.xml
file;rootfile
elements in the Container Document;Taken together, these features enable the creation of advanced Multiple-Rendition Publications that Reading Systems can adapt to changing user needs.
This section is non-normative.
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 EPUB Creators 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 EPUB Creators to listing
only a single Package Document. In EPUB 2, for example, EPUB Creators 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).
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 EPUB Creator 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.
The following terms used in this document are defined in [EPUB-33]:
In addition, this document defines the following terms:
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].
The Rendition listed in the first rootfile
element in the container.xml
file [EPUB-33].
An EPUB Publication that consists of two or more Renditions of the content.
One rendering of the content of an EPUB Publication, as expressed by a Package 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.
As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.
The key words MAY, MUST, MUST NOT, OPTIONAL, RECOMMENDED, and SHOULD in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
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.
Renditions may not be able to access resources stored in sibling directories on all Reading Systems (i.e., some Reading Systems do not provide access outside the directory a Rendition's Package Document is stored in).
For example, given the following directory structure (all resources except the Package Documents omitted for clarity):
/META-INF
/Rendition1
- rendition1.opf
/Rendition2
- rendition2.opf
/Shared
Resources in the "Rendition1
" directory may not be able to access resources in either
"Rendition2
" or "Shared
".
To share resources between Renditions, it is recommended that the Package Documents be located in a common directory and the resources for each Rendition stored in separate subdirectories.
Restructuring the previous example as follows would allow shared access to all resources:
/META-INF
/EPUB
/Rendition1
/Rendition2
/Shared
- rendition1.opf
- rendition2.opf
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.
metadata.xml
FileTo 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:
dc:identifier
element [DCTERMS] MUST contain the unique identifier [EPUB-33] for the EPUB
Publication.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.meta
element
[EPUB-33] is not allowed.meta
and link
elements are defined in the same namespace as
the metadata
root element: http://www.idpf.org/2013/metadata
metadata.xml
file,
all attributes allowed on the package
element [EPUB-33] are allowed on the root metadata
element.The content of this file is also defined informally through an XML schema. See § A.1 Metadata.xml Schema for further details.
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).
EPUB Creators 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 content model restrictions in this section are not
valid Multiple-Rendition Publications as defined by this specification, but might still be
valid EPUB 3 Publications.
EPUB Creators are strongly encouraged to migrate to the content model defined in this specification, even if not producing Multiple-Rendition Publications, to ensure consistent processing.
The resource obfuscation algorithm [EPUB-33] depends on creating an obfuscation key [EPUB-33] from the Unique Identifier for the EPUB Publication.
For compatibility reasons, and due to the complexities of being able to share resources across Renditions, this specification does not change this requirement but applies it to all obfuscated resources in the EPUB Container.
Consequently, EPUB Creators MUST use the Unique Identifier of the Default Rendition as the obfuscation key for all resources in a Multiple-Rendition Publication.
Similarly, Reading Systems MUST use this Unique Identifier of the Default Rendition to de-obfuscate all resources in a Multiple-Rendition Publication.
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.
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 EPUB
Creators 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.
A Container Document:
container.xml
file specified in Container –
META-INF/container.xml [EPUB-33].rootfile
element [EPUB-33]
for the Default Renditionrootfile
element.An EPUB Reading System SHOULD determine the Rendition to present to a user as defined in § 4.5 Processing Model.
The use of the rendition selection attributes in the container.xml
file
[EPUB-33] is also defined informally through an XML schema. See § A.2 Container.xml Schema for further details.
rendition:media
attributeThe rendition:media
attribute identifies the media features of a Reading System the
given Rendition is best suitable for rendering on.
media
http://www.idpf.org/2013/rendition
MAY be specified on Container Document rootfile
elements
[EPUB-33].
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).
rendition:layout
attributeThe rendition:layout
attribute indicates whether the given Rendition is
reflowable or pre-paginated.
layout
http://www.idpf.org/2013/rendition
MAY be specified on Container Document rootfile
elements
[EPUB-33].
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.
rendition:language
attributeThe rendition:language
attribute indicates that the given Rendition is
optimized for the specified language.
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.
rendition:accessMode
attributeThe 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.
accessMode
http://www.idpf.org/2013/rendition
MAY be specified on Container Document rootfile
elements
[EPUB-33].
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.
rendition:label
attributeThe rendition:label
attribute allows each rootfile
element [EPUB-33]
to be annotated with a human-readable name.
label
http://www.idpf.org/2013/rendition
MAY be specified on Container Document rootfile
elements
[EPUB-33].
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.
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:
rootfile
element and continue the
evaluation process.rootfile
element and continue the evaluation process.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, EPUB Creators 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.
This section is non-normative.
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.
An EPUB Publication MAY include an EPUB Rendition Mapping Document.
A conformant EPUB Rendition Mapping Document:
Reading Systems SHOULD support the use of Rendition Mapping Documents to switch between content.
A Reading System that supports mapping:
The content of this file is also defined informally through an XML schema. See § A.3 Mapping Document Schema for further details.
The Rendition Mapping Document is a compliant XHTML Content Document, but with the following restrictions on the [HTML] content model:
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.head
MAY contain only meta
elements. Only the
charset
attribute or name
and content
attributes MAY be attached to the meta
elements.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.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
.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 URL 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.
The location of the Rendition Mapping Document is identified in the Container Document using a link
element [EPUB-33],
where:
href
attribute MUST reference the location of the Rendition Mapping
Document relative to the root of the EPUB Container;rel
attribute MUST specify the value "mapping
";media-type
attribute MUST specify the value
"application/xhtml+xml
".The Container Document MUST NOT reference more than one mapping document.
This section is non-normative.
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:
First, it would ascertain the position range in the current Rendition:
Finally, the Reading System would parse the ul
elements to find ones that
contain li
elements with child a
elements that both specify the
same rendition and intersect the current range:
ul
element, the Reading System would
navigate to the beginning of the range in the new rendition. ul
element, then the Reading System behavior
is undefined. The Reading System might prompt the user to select between the new
locations, or might choose between them using its own heuristics.ul
elements are found, the Reading System will have to
determine the location to navigate to in the new Rendition as if there was no Rendition
Mapping Document.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.
This section is non-normative.
Validation using the schemas in this appendix requires a processor that supports [RELAXNG-SCHEMA] and [XMLSCHEMA11-2].
The schema for including metadata in the metadata.xml
file, as described in § 3.2 Publication Metadata, is available at https://github.com/w3c/epubcheck/blob/main/src/main/resources/com/adobe/epubcheck/schema/30/ocf-metadata-30.rnc.
The schema for including rendition selection attributes in the container.xml
file, as described in § 4. Rendition Selection, is available at
https://github.com/w3c/epubcheck/blob/main/src/main/resources/com/adobe/epubcheck/schema/30/multiple-renditions/container.rnc.
The schema for Mapping Documents, as described in § 5. Rendition Mapping, is available at https://github.com/w3c/epubcheck/blob/main/src/main/resources/com/adobe/epubcheck/schema/30/multiple-renditions/mapping.rnc.
This section is non-normative.
Note that this change log only identifies substantive changes since EPUB Multiple-Rendition Publications 1.0 — 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.
metadata.xml
file for
obfuscating resources and recommend it be the same as the identifier in the default rendition. See
issue 1443.link
element being a child of the
container
element. See issue 584.metadata.xml
file remain for backwards compatibility. See issue 1440.This section is non-normative.
The following members of the EPUB 3 Working Group contributed to the development of this specification:
Referenced in:
Referenced in: