這是用戶在 2024-6-27 13:53 為 https://www.w3.org/TR/epub-33/#example-escapable-structures 保存的雙語快照頁面,由 沉浸式翻譯 提供雙語支持。了解如何保存?

Jump to Table of Contents Collapse Sidebar

EPUB 3.3 EPUB 3.3 (英语)

W3C Recommendation
W3C 建議 2023 年 5 月 25 日

More details about this document
This version: 此版本:
Latest published version:
Latest editor's draft: 最新編輯草稿:
History: 歷史:
Commit history 提交歷史記錄
Test suite: 測試套件:
Implementation report: 執行報告:
Editors: 編輯:
Matt Garrish (DAISY Consortium)
馬特·加里什(DAISY Consortium)
Ivan Herman (W3C)
伊萬·赫爾曼 ( W3C)
Dave Cramer (Invited Expert)
Dave Cramer (特邀專家)
Feedback: 回饋:
GitHub w3c/epub-specs (pull requests, new issue, open issues)
GitHub w3c/epub-specs (拉取請求、新問題、未解決問題)
public-epub-wg@w3.org with subject line [epub-33] … message topic … (archives)
帶主題行 [epub-33] … message topic … 的 public-epub-wg@w3.org ( archives)
Errata: 勘誤表:
This document is also available in this non-normative format:
EPUB 3 EPUB 3 (英语)

See also translations.

Abstract 抽象

EPUB® 3 defines a distribution and interchange format for digital publications and documents. The EPUB format provides a means of representing, packaging, and encoding structured and semantically enhanced web content — including HTML, CSS, SVG, and other resources — for distribution in a single-file container.
EPUB® 3 定義了數位出版物和文檔的分發和交換格式。EPUB 格式提供了一種表示、打包和編碼結構化和語義增強的 Web 內容(包括 HTML、CSS、SVG 和其他資源)的方法,以便在單個檔容器中分發。

This specification defines the authoring requirements for EPUB publications and represents the third major revision of the standard.
該規範定義了 EPUB 出版物的創作要求,代表了該標準的第三次主要修訂。

Status of This Document 本文件的現狀

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/.
本節介紹本文檔發佈時的狀態。當前 W3C 出版物清單和本技術報告的最新版本可在 https://www.w3.org/TR/ 的 W3C 技術報告索引中找到。

This document was published by the EPUB 3 Working Group as a Recommendation using the Recommendation track.
本文檔由 EPUB 3 工作組使用建議書軌道作為建議書發佈。

W3C recommends the wide deployment of this specification as a standard for the Web.
W3C 建議將此規範作為 Web 標準廣泛部署。

A W3C Recommendation is a specification that, after extensive consensus-building, is endorsed by W3C and its Members, and has commitments from Working Group members to royalty-free licensing for implementations. Future updates to this Recommendation may incorporate new features.
W3C 推薦標準是經過廣泛共識建立后,由 W3C 及其成員認可的規範,工作組成員承諾免版稅許可實施。本建議書的未來更新可能會包含新功能。

This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
本文檔由一個根據 W3C 專利政策運作的小組編寫。W3C 維護著與該小組的可交付成果相關的任何專利披露的公開清單;該頁面還包括披露專利的說明。如果個人實際瞭解其認為包含基本權利要求的專利,則必須根據 W3C 專利政策第 6 節披露該資訊。

This document is governed by the 2 November 2021 W3C Process Document.
本文檔受 2021 年 11 月 2 日 W3C 流程文檔的約束。

1. Introduction 1. 引言

1.1 Overview 1.1 概述

This section is non-normative.

EPUB 3 has been widely adopted as the format for digital books (ebooks), and this revision continues to increase the format's capabilities to better support a wider range of publication requirements, including complex layouts, rich media and interactivity, and global typography features. The expectation is that publishers will utilize the EPUB 3 format for a broad range of content, including books, magazines, and educational, professional, and scientific publications.
EPUB 3 已被廣泛採用為數位圖書 (ebooks) 的格式,此次修訂繼續增強該格式的功能,以更好地支援更廣泛的出版要求,包括複雜的佈局、富媒體和交互性以及全域排版功能。預計出版商將 EPUB 3 格式用於廣泛的內容,包括書籍、雜誌以及教育、專業和科學出版物。

This specification represents the core of EPUB 3 and includes the conformance requirements for EPUB publications — the product of the standard. The other specifications that comprise EPUB 3 are as follows:
該規範代表了 EPUB 3 的核心,包括 EPUB 出版物(標準的產物)的一致性要求。包含 EPUB 3 的其他規格如下:

These specifications represent the formal list recognized as belonging to EPUB 3 and that contain functionality normatively referenced as part of the standard. The development of extension specifications periodically adds new functionality to EPUB publications. Features and functionality defined outside of core revisions to the standard, while not formally recognized in this specification, are nonetheless available for EPUB creators and reading system developers to use.
這些規範代表了公認的屬於 EPUB 3 的正式清單,其中包含作為標準一部分規範引用的功能。擴展規範的開發會定期向 EPUB 出版物添加新功能。在標準核心修訂版之外定義的特性和功能,雖然未在本規範中得到正式認可,但仍可供EPUB創建者和閱讀系統開發人員使用。

The non-normative EPUB 3 Overview [epub-overview-33] provides a general introduction to EPUB 3. A list of technical changes from the previous version is also available in the change log.
非規範性 EPUB 3 概述 [ epub-overview-33] 提供了 EPUB 3 的一般介紹。更改日誌中還提供了與先前版本相比的技術更改清單。

1.2 Organization 1.2 組織

This section is non-normative.

This section reviews the organization of this specification through the central product it defines: the EPUB publication.
本節通過它定義的核心產品(EPUB 出版物)回顧了本規範的組織。

An EPUB publication is, in its most basic sense, a bundle of resources with instructions on how to render those resources to present the content in a logical order. The types of resources that are allowed in EPUB publication, as well as restrictions on their use, are defined in 3. Publication resources.
從最基本的意義上說,EPUB 出版物是一組資源,其中包含有關如何呈現這些資源以按邏輯順序呈現內容的說明。EPUB 出版物中允許的資源類型及其使用限制在 3 中定義。出版資源。

A ZIP-based archive with the file extension .epub bundles the EPUB publication's resources for distribution. As conformant ZIP archives, EPUB publications can be unzipped by many software programs, simplifying both their production and consumption.
帶有文件擴展名 .epub 的基於 ZIP 的存檔捆綁了 EPUB 出版物的資源以供分發。作為符合標準的 ZIP 存檔,EPUB 出版物可以由許多軟體程式解壓縮,從而簡化其生產和使用。

The container format not only provides a means of determining that the zipped content represents an EPUB publication (the mimetype file), but also provides a universally named directory of non-normative resources (/META-INF). Key among these resources is the container.xml file, which directs reading systems to the available package documents. Refer to 4. Open Container Format (OCF) for more information about the container format.
容器格式不僅提供了一種確定壓縮內容是否代表 EPUB 出版物( mimetype 檔)的方法,而且還提供了非規範性資源 ( /META-INF ) 的通用命名目錄。這些資源中的關鍵是 container.xml 檔,它將讀取系統定向到可用的包文檔。請參閱 4。打開容器格式 (OCF) 以獲取有關容器格式的詳細資訊。

An EPUB publication is typically represented by a single package document. This document includes metadata used by reading systems to present the content to the user, such as the title and author for display in a bookshelf as well as rendering metadata (e.g., whether the content is reflowable or has a fixed layout). It also provides a manifest of resources and includes a spine that lists the default sequence in which to render documents as a user progresses through the content. Refer to 5. Package document for the requirements for the package document.
EPUB 出版物通常由單個包文檔表示。本文檔包括閱讀系統用於向使用者呈現內容的元數據,例如在書架上顯示的標題和作者以及呈現元數據(例如,內容是否可重排或具有固定佈局)。它還提供資源清單,並包括一個主幹,該主幹列出了使用者在瀏覽內容時呈現文檔的預設順序。請參閱 5。包文檔,瞭解包文檔的要求。

The actual content of an EPUB publication — what users are presented with when they begin reading — is built on the Open Web Platform and comes in two flavors: XHTML and SVG. Called EPUB content documents, these documents typically reference many additional resources required for their proper rendering, such as images, audio and video clips, scripts, and style sheets.
EPUB 出版物的實際內容(用戶開始閱讀時看到的內容)建立在開放Web平臺上,有兩種風格:XHTML 和SVG。這些文檔稱為EPUB內容文檔,通常引用正確呈現所需的許多其他資源,例如圖像、音訊和視頻剪輯、腳本和樣式表。

Refer to 6. EPUB content documents for detailed information about the rules and requirements to produce EPUB content documents, and [epub-a11y-11] for accessibility requirements.
請參閱 6。EPUB 內容文件,瞭解有關生成 EPUB 內容文件的規則和要求的詳細資訊,以及 [ epub-a11y-11] 的輔助功能要求。

An EPUB publication also includes another key file called the EPUB navigation document. This document provides critical navigation capabilities, such as the table of contents, that allow users to navigate the content quickly and easily. The navigation document is a specialized type of XHTML content document which also allows EPUB creators to use it in the content (i.e., avoiding one table of contents for machine processing and another for user consumption). Refer to 7. EPUB navigation document for more information about this document.
EPUB 出版物還包括另一個稱為 EPUB 導航文檔的密鑰檔。本文檔提供了關鍵的導航功能,如目錄,使用戶能夠快速輕鬆地瀏覽內容。導航文檔是一種特殊類型的 XHTML 內容文檔,它還允許 EPUB 建立者在內容中使用它(即,避免一個目錄用於機器處理,另一個目錄用於使用者使用)。請參閱 7。EPUB 導航文檔,瞭解有關此文檔的詳細資訊。

EPUB publications by default are intended to reflow to fit the available screen space. It is also possible to create publications that have pixel-precise fixed layouts using images and/or CSS positioning. The metadata to control layouts are defined in 8. Layout rendering control.
默認情況下,EPUB 出版物旨在重排以適應可用的屏幕空間。還可以使用圖像和/或 CSS 定位創建具有圖元精確固定佈局的出版物。用於控制佈局的元數據在8中定義。佈局呈現控制件。

Media overlay documents complement EPUB content documents. They provide declarative markup for synchronizing the text in EPUB content documents with prerecorded audio. The result is the ability to create a read-aloud experience where reading systems highlight the text as it is narrated. Refer to 9. Media overlays for the definition of media overlay documents.
媒體疊加文檔是對 EPUB 內容文檔的補充。它們提供聲明性標記,用於將 EPUB 內容文件中的文字與預先錄製的音訊同步。其結果是能夠創建朗讀體驗,其中閱讀系統在敘述文本時突出顯示文本。請參閱 9。用於定義媒體疊加文檔的媒體疊加。

While conceptually simple, an EPUB publication is more than just a collection of HTML pages and dependent assets in a ZIP package as presented here. Additional information about the primary features and functionality that EPUB publications provide to enhance the reading experience is available from the referenced specifications, and a more general introduction to the features of EPUB 3 is provided in the non-normative [epub-overview-33].
雖然概念上很簡單,但 EPUB 出版物不僅僅是 ZIP 包中 HTML 頁面和依賴資產的集合,如此處所示。有關 EPUB 出版物為增強閱讀體驗而提供的主要特性和功能的其他資訊,請參閱參考規範,非規範性 [ epub-overview-33] 中提供了對 EPUB 3 特性的更一般介紹。

Refer to [epub-rs-33] for the processing requirements for reading systems. Although it is not necessary that EPUB creators read that document to create EPUB publications, an understanding of how reading systems present the content can help craft publications for optimal presentation to users.
請參閱 [ epub-rs-33] 了解讀取系統的處理要求。儘管 EPUB 建立者不必閱讀該文件來創建 EPUB 出版物,但瞭解閱讀系統如何呈現內容有助於製作出版物,以便以最佳方式呈現給使用者。

1.3 Relationship to other specifications
1.3 與其他規範的關係

This section is non-normative.

Caution 謹慎

The technologies EPUB 3 builds on are constantly evolving. Some, typically referred to as "living" or "evergreen" standards, are subject to change daily and their impact on the validity of EPUB publications is immediate. Others are updated less frequently and the changes may not affect EPUB publications until EPUB 3 undergoes a new revision.
EPUB 3 所基於的技術在不斷發展。有些標準通常被稱為“活”或“常青”標準,每天都在變化,它們對 EPUB 出版物的有效性的影響是立竿見影的。其他版本的更新頻率較低,在 EPUB 3 進行新修訂之前,這些更改可能不會影響 EPUB 出版物。

In all cases, it is possible that previously valid features may become obsolete (e.g., due to a lack of support or because of security issues). EPUB creators should therefore be cautious about using any feature without broad support and keep their EPUB conformance checkers up to date.
在所有情況下,以前有效的功能都可能過時(例如,由於缺乏支援或安全問題)。因此,EPUB 建立者在使用沒有廣泛支援的任何功能時應謹慎,並使其 EPUB 一致性檢查器保持最新狀態。

1.3.1 Relationship to HTML
1.3.1 與 HTML 的關係

The [html] standard is continuously evolving — there are no longer versioned releases of it. That standard, in turn, references various technologies that continue to evolve, such as MathML, SVG, CSS, and JavaScript.
[ html] 標準在不斷發展 - 不再有版本版本。反過來,該標準引用了不斷發展的各種技術,例如MathML、SVG、CSS和JavaScript。

The benefit of this approach for EPUB is that EPUB publications always keep pace with changes to the web without the need for new revisions. EPUB creators, however, must keep track of the various changes to HTML and the technologies it references to ensure they keep their processes up to date.
這種方法對 EPUB 的好處是,EPUB 出版物始終與網路的變化保持同步,而無需新的修訂。但是,EPUB 建立者必須跟蹤對 HTML 及其引用的技術的各種更改,以確保他們保持流程最新。

The XHTML profile defined by this specification inherits all definitions of semantics, structure and processing behaviors from HTML unless otherwise specified.
除非另有說明,否則本規範定義的 XHTML 配置檔繼承了 HTML 語義、結構和處理行為的所有定義。

In addition, this specification defines a set of extensions to the [html] document model that EPUB creators may include in XHTML content documents.
此外,此規範還定義了 [ html] 文檔模型的一組擴展,EPUB 建立者可以將其包含在 XHTML 內容文檔中。

1.3.2 Relationship to SVG
1.3.2 與SVG的關係

This specification does not reference a specific version of [svg], but instead uses an undated reference. Whenever there is any ambiguity in this reference, the latest recommended specification is the authoritative reference.
此規範不引用 [ svg] 的特定版本,而是使用未註明日期的引用。每當此參考文獻中有任何歧義時,最新推薦的規範就是權威參考文獻。

This approach ensures that EPUB will always keep pace with changes to the SVG standard. EPUB creators, however, must keep track of changes to the SVG standard to ensure they keep their processes up to date.
這種方法可確保 EPUB 始終跟上 SVG 標準的變化。但是,EPUB 建立者必須跟蹤 SVG 標準的更改,以確保他們保持流程最新。

1.3.3 Relationship to CSS
1.3.3 與CSS的關係

EPUB 3 supports CSS as defined by the CSS Working Group Snapshot [csssnapshot]. EPUB 3 also maintains some prefixed CSS properties, to ensure consistent support for global languages.
EPUB 3 支援 CSS 工作組快照 [ csssnapshot] 定義的 CSS。EPUB 3 還保留了一些前綴的 CSS 屬性,以確保對全域語言的一致支援。

1.3.4 Relationship to MathML
1.3.4 與MathML的關係

EPUB 3 only supports Presentation Markup [mathml3]. Content Markup is only allowed in structured markup annotations.
EPUB 3 僅支援表示標記 [ mathml3]。內容標記只允許在結構化標記批註中使用。

1.3.5 Relationship to SMIL
1.3.5 與SMIL的關係

This specification relies on a subset of [smil3], from which the media overlays elements and attributes defined in 9.2.2 Media overlay document definition are derived.
此規範依賴於 [ smil3] 的子集,從該子集派生出 9.2.2 媒體疊加文檔定義中定義的媒體疊加元素和屬性。

1.3.6 Relationship to URL
1.3.6 與 URL 的關係

This specification refers to the [url] standard for terminology and processing related to URLs expressed in EPUB publications. It is anticipated that new and revised web formats will adopt this standard, but until then this may put this specification in conflict with the internal requirements for some formats (e.g., valid relative paths), specifically with respect to the use of internationalized URLs. If a format does not allow internationalized URLs (i.e., URLs must conform to [rfc3986] or earlier), that requirement takes precedence within those resources.
本規範是指 [ url] 標準,用於與 EPUB 出版物中表示的 URL 相關的術語和處理。預計新的和修訂的 Web 格式將採用此標準,但在此之前,這可能會使該規範與某些格式(例如,有效的相對路徑)的內部要求相衝突,特別是在使用國際化 URL 方面。如果格式不允許國際化 URL(即 URL 必須符合 [ rfc3986] 或更早版本),則該要求在這些資源中優先。

1.4 Terminology 1.4 術語

This specification defines the following terms specific to EPUB 3.
本規範定義了特定於 EPUB 3 的以下術語。

Note 注意

Only the first instance of a term in a section links to its definition.

codec 編 解碼 器

Codec refers to content that has intrinsic binary format qualities, such as video and audio media types designed for optimum compression or that provide optimized streaming capabilities.

container resource 容器資源

A publication resource that is located within the EPUB container, as opposed to a remote resource which is not.
位於 EPUB 容器中的發佈資源,而不是位於 EPUB 容器中的遠端資源。

Refer to 3.6 Resource locations for media type-specific rules for resource locations.
有關資源位置的特定於媒體類型的規則,請參閱 3.6 資源位置。

container root URL 容器根 URL

The URL [url] of the root directory representing the OCF abstract container. It is implementation specific, but EPUB creators must assume it has properties defined in 4.2.5 URLs in the OCF abstract container.
表示 OCF 抽象容器的根目錄的 URL [ url]。它是特定於實現的,但 EPUB 建立者必須假定它具有在 OCF 抽象容器的 4.2.5 URL 中定義的屬性。

content URL 內容 URL

The URL of a file or directory in the OCF abstract container, defined in 4.2.5 URLs in the OCF abstract container.
OCF 抽象容器中檔或目錄的 URL,在 OCF 抽象容器的 4.2.5 URL 中定義。

core media type resource

A publication resource that conforms to one of the MIME media types [rfc2046] listed in 3.2 Core media types and, therefore, does not require the provision of a fallback (cf. foreign resource).
符合 3.2 核心媒體類型中列出的 MIME 媒體類型之一 [ rfc2046] 的發佈資源,因此不需要提供回退(參見外部資源)。

The designation "core media type resource" only applies when a resource is used in the rendering of EPUB content documents and foreign content documents. A core media type resource cannot be used in the spine, for example, without a fallback unless it also has the media type of an EPUB content document.
僅當資源用於呈現EPUB內容文檔和外部內容文檔時,「核心媒體類型資源」的名稱才適用。例如,核心媒體類型資源不能在沒有回退的情況下在主幹中使用,除非它還具有 EPUB 內容文檔的媒體類型。

EPUB conformance checker EPUB 一致性檢查器

An application that verifies the requirements of this specification against EPUB publications and reports on their conformance.
根據 EPUB 出版物驗證本規範要求並報告其符合性的應用程式。

EPUB container EPUB 容器
OCF ZIP container OCF ZIP容器

The ZIP-based packaging and distribution format for EPUB publications defined in 4.3 OCF ZIP container.
在 4.3 OCF ZIP 容器中定義的 EPUB 出版物的基於 ZIP 的打包和分發格式。

EPUB container and OCF ZIP container are synonymous.
EPUB 容器和 OCF ZIP 容器是同義詞。

EPUB content document EPUB 內容文件

A publication resource referenced from the spine or a manifest fallback chain that conforms to either the XHTML or SVG content document definitions.
從符合 XHTML 或 SVG 內容文件定義的主幹或清單回退鏈引用的發佈資源。

EPUB content documents contain all or part of the content of an EPUB publication (i.e., the textual, visual and/or audio content).
EPUB 內容文件包含 EPUB 出版物的全部或部分內容(即文字、視覺和/或音訊內容)。

EPUB creators can include EPUB content documents in the spine without the provision of fallbacks.
EPUB 建立者可以在主幹中包含 EPUB 內容文件,而無需提供回退。

EPUB creator EPUB 建立者

An individual, organization, or process that produces an EPUB publication.
生成 EPUB 出版物的個人、組織或流程。

Note 注意

The creation of an EPUB publication often involves the work of many individuals, and may be split across multiple organizations (e.g., when a publisher outsources all or part of the work). Depending on the process used to produce an EPUB publication, responsibilities may fall on the organization (e.g., the publisher), the individuals preparing the publication (e.g., technical editors), or automatic procedures (e.g., as part of a publication pipeline). As a result, not every party or process may be responsible for ensuring every requirement is met, but there is always an EPUB creator responsible for the conformance of the final EPUB publication.
EPUB 出版物的創建通常涉及許多人的工作,並且可能被拆分到多個組織(例如,當出版商將全部或部分工作外包時)。根據用於製作 EPUB 出版物的流程,責任可能落在組織(例如出版商)、準備出版物的個人(例如技術編輯)或自動程式(例如,作為出版物管道的一部分)上。因此,並非每一方或流程都有責任確保滿足每個要求,但總有一個 EPUB 建立者負責最終 EPUB 出版物的一致性。

Previous versions of this specification referred to the EPUB creator as the Author.
此規範的早期版本將 EPUB 建立者稱為作者。

EPUB manifest (or manifest)
EPUB 清單(或清單)

The section of the package document that lists the publication resources.

Refer to 5.6.1 The manifest element for more information.
有關詳細資訊,請參閱 5.6.1 元素 manifest

EPUB navigation document
EPUB 導航文件

A specialization of the XHTML content document that contains human- and machine-readable global navigation information. The EPUB navigation document conforms to the constraints expressed in 7. EPUB navigation document.
XHTML 內容文件的專用化,包含人類和機器可讀的全域導航資訊。EPUB 導航文件符合 7 中表示的約束條件。EPUB 導航文件。

EPUB publication EPUB 出版物

A logical document entity consisting of a set of interrelated resources packaged in an EPUB container.
一個邏輯文檔實體,由打包在 EPUB 容器中的一組相互關聯的資源組成。

An EPUB publication typically represents a single intellectual or artistic work, but this specification does not restrict the nature of the content.
EPUB 出版物通常代表單一的智力或藝術作品,但此規範不限制內容的性質。

EPUB reading system (or reading system)
EPUB 閱讀系統(或閱讀系統)

A system that processes EPUB publications for presentation to a user in a manner conformant with this specification.
處理 EPUB 出版物以符合本規範的方式呈現給用戶的系統。

EPUB spine (or spine) EPUB脊柱(或脊柱)

The section of the package document that defines an ordered list of EPUB content documents and foreign content documents. This list represents the default reading order of the EPUB publication.
包文檔中定義 EPUB 內容文件和外部內容文檔的有序清單的部分。此清單表示 EPUB 出版物的預設閱讀順序。

Refer to 5.7.1 The spine element for more information.
有關詳細資訊,請參閱 5.7.1 元素 spine

exempt resource 豁免資源

Exempt resources are a special class of publication resources that reading systems are not required to support the rendering of, but EPUB creators do not have to provide fallbacks for.
豁免資源是一類特殊的出版資源,閱讀系統不需要支持呈現,但 EPUB 建立者不必為其提供後備。

Refer to 3.4 Exempt resources for more information.
有關詳細資訊,請參閱 3.4 豁免資源。

file name 檔名

The name of any type of file within an OCF abstract container, whether a directory or a file within a directory.
OCF 抽象容器中任何類型的檔的名稱,無論是目錄還是目錄中的檔。

file path 檔路徑

The file path of a file or directory is its full path relative to the root directory, as defined by the algorithm specified in 4.2.4 Deriving file paths.
文件或目錄的文件路徑是其相對於根目錄的完整路徑,由 4.2.4 派生文件路徑中指定的演算法定義。

fixed-layout document 固定版面文件

An EPUB content document with fixed dimensions directly referenced from the spine. Fixed-layout documents are designated pre-paginated in the package document, as defined in 8.2 Fixed layouts.
具有固定尺寸的 EPUB 內容文件,直接從書脊引用。固定版面文檔在包文檔中指定 pre-paginated ,如 8.2 固定版式中所定義。

foreign content document

Any publication resource referenced from a spine itemref element, or a manifest fallback chain, that is not an EPUB content document.
從主幹 itemref 元素或清單回退鏈引用的任何發佈資源,該資源不是 EPUB 內容文檔。

When a foreign content document is referenced from a spine itemref element, it requires a manifest fallback chain with at least one EPUB content document.
當從主幹 itemref 元素引用外部內容文檔時,它需要包含至少一個 EPUB 內容文檔的清單回退鏈。

Note 注意

With the exception of XHTML and SVG, all core media type resources are foreign content documents when referenced directly from the spine.
除 XHTML 和 SVG 外,所有核心媒體類型資源在直接從書脊引用時都是外來內容文檔。

foreign resource 國外資源

A publication resource with a MIME media type [rfc2046] that does not match any of those listed in 3.2 Core media types. Foreign resources are subject to the fallback requirements defined in 3.3 Foreign resources.
MIME 媒體類型 [ rfc2046] 與 3.2 核心媒體類型中列出的任何媒體類型不匹配的發佈資源。外部資源受 3.3 外部資源中定義的後備要求的約束。

The designation "foreign resource" only applies to resources used in the rendering of EPUB content documents and foreign content documents.
“外部資源”名稱僅適用於用於呈現 EPUB 內容文檔和外部內容文檔的資源。

Note 注意

Foreign resource and foreign content document are not interchangeable terms. The types of resources considered foreign when used in the spine is greater than the types of resources considered foreign when used in EPUB content documents.
“外國資源”和“外國內容”文檔是不可互換的術語。在主幹中使用時被視為外來的資源類型大於在 EPUB 內容文檔中使用時被視為外來的資源類型。

linked resource 鏈接資源

A resource that is only referenced from a package document link element (i.e., not also used in the rendering of an EPUB publication.
僅從包文檔 link 元素引用的資源(即,不用於呈現EPUB 出版物。

Linked resources are not publication resources but may be stored in the EPUB container. They do not require fallbacks.
鏈接的資源不是發佈資源,但可以存儲在 EPUB 容器中。它們不需要回退。

media overlay document 媒體疊加文件

An XML document that associates the XHTML content document with pre-recorded audio narration to provide a synchronized playback experience, as defined in 9. Media overlays.
一個 XML 文件,它將 XHTML 內容文件與預先錄製的音訊旁白相關聯,以提供同步播放體驗,如 9 中所定義。媒體疊加。

non-codec 非編解碼器

Non-codec refers to content types that benefit from compression due to the nature of their internal data structure, such as file formats based on character strings (for example, HTML, CSS, etc.).
非編解碼器是指由於其內部數據結構的性質而受益於壓縮的內容類型,例如基於字串的檔格式(例如,HTML、CSS 等)。

OCF abstract container OCF抽象容器

The OCF abstract container defines a file system model for the contents of the OCF ZIP container, as defined in 4.2 OCF abstract container.
OCF 抽象容器為 OCF ZIP 容器的內容定義檔案系統模型,如 4.2 OCF 抽象容器中所定義。

package document 包裝文件

A publication resource that describes the rendering of an EPUB publication, as defined in 5. Package document. The package document carries meta information about the EPUB publication, provides a manifest of resources, and defines a default reading order.
描述 EPUB 出版物呈現的發佈資源,如 5 中所定義。包文檔。包文檔包含有關 EPUB 發佈的元資訊,提供資源清單,並定義預設讀取順序。

publication resource 出版資源

A resource that contains content or instructions that contribute to the logic and rendering of an EPUB publication. In the absence of this resource, reading systems may not render the EPUB publication as the EPUB creator intends. Examples of publication resources include the package document, EPUB content documents, CSS Style Sheets, audio, video, images, embedded fonts, and scripts.
包含有助於 EPUB 出版物的邏輯和呈現的內容或說明的資源。如果沒有此資源,閱讀系統可能無法按照 EPUB 建立者的意圖呈現 EPUB 出版物。發佈資源的範例包括包文件、EPUB 內容文件、CSS 樣式表、音訊、視頻、圖像、嵌入字型和腳本。

EPUB creators must list publication resources in the package document manifest and typically bundle them all in the EPUB container (the exception being they may locate resources listed in 3.6 Resource locations outside the EPUB container).
EPUB 建立者必須在包文檔清單中列出發佈資源,並且通常將它們全部捆綁在 EPUB 容器中(例外情況是,他們可以在 EPUB 容器之外找到 3.6 資源位置中列出的資源)。

Note 注意

Resources on the web identified in outbound hyperlinks (e.g., referenced from the href attribute of an [html] a element) are not publication resources.
在出站超連結中標識的 Web 資源(例如,從 [ html] a 元素 href 的屬性引用)不是發佈資源。

Data urls are also not publication resources — they are considered part of the resource they are embedded in.
數據 URL 也不是發布資源,它們被視為嵌入到其中的資源的一部分。

remote resource 遠程資源

A publication resource that is located outside of the EPUB container, typically, but not necessarily, on the web.
位於 EPUB 容器外部的發佈資源,通常(但不一定)位於 Web 上。

Publication resources within the EPUB container are referred to as container resources.
EPUB 容器中的發佈資源稱為容器資源。

Refer to 3.6 Resource locations for media type specific rules for resource locations.
請參閱 3.6 資源位置,了解資源位置的媒體類型特定規則。

root directory 根目錄

The root directory represents the base of the OCF abstract container file system. This directory is virtual in nature.
根目錄表示 OCF 抽象容器文件系統的基礎。此目錄本質上是虛擬的。

scripted content document

An EPUB content document that includes scripting or an XHTML content document that contains [html] form elements.
包含文稿的 EPUB 內容文件或包含 [ html] form 元素的 XHTML 內容文件。

Refer to 6.3.2 Scripting for more information.
有關詳細資訊,請參閱 6.3.2 腳本。

SVG content document SVG 內容文件

An EPUB content document that conforms to the constraints expressed in 6.2 SVG content documents.
符合 6.2 SVG 內容文件中表示的約束的 EPUB 內容文檔。

synthetic spread 合成傳播

The rendering of two adjacent pages simultaneously on a device screen.

top-level content document

An EPUB content document or foreign content document referenced from the spine, whether directly or via a fallback chain.
從書脊引用的 EPUB 內容文件或外部內容文檔,無論是直接引用還是通過回退鏈引用。

unique identifier 唯一標識碼

The primary identifier for an EPUB publication. The unique identifier is the value of the dc:identifier element specified by the unique-identifier attribute in the package document.
EPUB 出版物的主要標識碼。唯一標識碼是包文檔中屬性 unique-identifier 指定的 dc:identifier 元素的值。

Significant revision, abridgement, etc. of the content requires a new unique identifier.

viewport 視窗

The region of an EPUB reading system in which an EPUB publication is rendered visually to a user.
EPUB 閱讀系統的區域,在其中以可視方式向用戶呈現EPUB出版物。

XHTML content document XHTML 內容文件

An EPUB content document that conforms to the profile of [html] defined in 6.1 XHTML content documents.
符合 6.1 XHTML 內容文件中定義的 [ html] 設定檔的 EPUB 內容文件。

XHTML content documents use the XML syntax defined in [html].
XHTML 內容文件使用[ html] 中定義的 XML 語法。

1.5 Conformance 1.5 一致性

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, REQUIRED, SHOULD, and SHOULD NOT 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.
本文件中的關鍵詞“可以”、“必須”、“不得”、“可選”、“推薦”、“必需”、“應該”和“不應”應按照 BCP 14 [ RFC2119] [ RFC8174] 中的描述進行解釋,當且僅當它們出現在所有大寫字母中時,如圖所示。

All algorithm explanations are non-normative.

1.6 Authoring shorthands 1.6 創作速記

This section is non-normative.

In package document metadata examples, reserved prefixes are used without declaration.

References to Dublin Core elements [dcterms] use the dc: prefix. This prefix must be declared in the package document for their use to be valid (xmlns:dc="http://purl.org/dc/elements/1.1/")
對 Dublin Core 元素 [ dcterms] 的引用使用前 dc: 綴。必須在包文件中聲明此前綴才能使用( xmlns:dc="http://purl.org/dc/elements/1.1/"

The epub namespace prefix [xml-names] is also used on elements and attributes without always having an explicit declaration (xmlns:epub="http://www.idpf.org/2007/ops").
epub 命名空間前綴 [ xml-names] 也用於元素和屬性,但並不總是具有顯式聲明 ( xmlns:epub="http://www.idpf.org/2007/ops" )。

2. EPUB publication conformance
2. EPUB 出版物一致性

An EPUB publication: EPUB 出版物:

In addition, all publication resources MUST adhere to the requirements in 3. Publication resources.
此外,所有出版資源必須符合 3.出版資源。

The rest of this specification covers specific conformance details.

2.1 Conformance checking 2.1 一致性檢查

This section is non-normative.

Due to the complexity of this specification and number of technologies used in EPUB publications, EPUB creators are advised to use an EPUB conformance checker to verify the conformance of their content.
由於此規範的複雜性和 EPUB 出版物中使用的技術數量,建議 EPUB 建立者使用 EPUB 一致性檢查器來驗證其內容的一致性。

EPUBCheck is the de facto EPUB conformance checker used by the publishing industry and has been updated with each new version of EPUB. It is integrated into a number of authoring tools and also available in alternative interfaces and other languages (for more information, refer to its Apps and Tools page).
EPUBCheck 是出版業使用的事實上的 EPUB 一致性檢查器,並且已隨 EPUB 的每個新版本進行了更新。它已整合到許多創作工具中,並且還提供替代介面和其他語言(有關更多資訊,請參閱其應用程式和工具頁面)。

When verifying their EPUB publications, EPUB creators should ensure they do not violate the requirements of this specification (practices identified by the keywords "MUST", "MUST NOT", and "REQUIRED"). These types of issues will often result in EPUB publications not rendering or rendering in inconsistent ways. These issues are typically reported as errors or critical errors.
在驗證其 EPUB 出版物時,EPUB 建立者應確保他們不違反本規範的要求(由關鍵字“MUST”、“MUST NOT”和“REQUIRED”標識的做法)。這些類型的問題通常會導致 EPUB 出版物無法呈現或呈現方式不一致。這些問題通常報告為錯誤或嚴重錯誤。

EPUB creators should also ensure that their EPUB publications do not violate the recommendations of this specification (practices identified by the keywords "SHOULD", "SHOULD NOT", and "RECOMMENDED"). Failure to follow these practices does not result in an invalid EPUB publication but may lead to interoperability problems and other issues that impact the user reading experience. These issues are typically reported as warnings.
EPUB 建立者還應確保其 EPUB 出版物不違反本規範的建議(由關鍵字“SHOULD”、“SHOULD NOT”和“RECOMMENDED”標識的做法)。不遵循這些做法不會導致 EPUB 發佈無效,但可能會導致互操作性問題和其他影響使用者閱讀體驗的問題。這些問題通常報告為警告。

Note 注意

Vendors, distributors, and other retailers of EPUB publications should consider the importance of recommended practices before basing their acceptance or rejection on a zero-issue outcome from an EPUB conformance checker. There will be legitimate reasons why EPUB creators cannot follow recommended practices in all cases.
EPUB 出版物的供應商、分銷商和其他零售商在根據 EPUB 一致性檢查器的零問題結果接受或拒絕之前,應考慮推薦做法的重要性。EPUB 建立者在所有情況下都無法遵循推薦的做法是有正當理由的。

3. Publication resources 3. 出版資源

3.1 Introduction 3.1 引言

This section is non-normative.

An EPUB publication is made up of many different categories of resources, not all of which are mutually exclusive. Some resources are publication resources, some are not. Some publication resources are allowed in the spine by default, while all others require fallbacks. Some resources can be used in rendering EPUB content documents, while others can only be used with fallbacks.
EPUB 出版物由許多不同類別的資源組成,並非所有資源都是相互排斥的。有些資源是出版資源,有些則不是。默認情況下,主幹中允許某些發佈資源,而所有其他資源都需要回退。某些資源可用於呈現 EPUB 內容文件,而其他資源只能用於回退。

Trying to understand these differences by reading the technical definitions of each category of resource can be complex. To make the categorizations easier to understand, this introduction uses the concept of different planes to explain how resources are grouped and referred to.

The three planes are:

The same resource may exist on more than one plane and will be referred to differently in this specification depending on which plane is being discussed. For example, a core media type resource used in the rendering of an EPUB content document (on the content plane) may also be a foreign content document if it is also listed in the spine (the spine plane).

The following sections describe these planes in more detail.

Note 注意

Refer to H.1 Resources for a detailed example showing how resources fit into the different planes.
請參閱 H.1 資源,瞭解資源如何適應不同平面的詳細示例。

3.1.1 The manifest plane 3.1.1 清單平面

To manifest plane defines all the resources of an EPUB publication. It is analogous to the package document manifest, but includes resources not present in that list.
清單平面定義 EPUB 發佈的所有資源。它類似於包文檔清單,但包括該清單中不存在的資源。

The primary resources in this group are designated publication resources, which are all the resources used in rendering an EPUB publication to the user. EPUB creators always have to list these resources in the manifest element.
此組中的主要資源是指定的發佈資源,這些資源是用於向用戶呈現EPUB出版物的所有資源。EPUB 建立者始終必須在 manifest 元素中列出這些資源。

Publication resources are further classified by their use(s) in the spine plane and content plane.

The manifest plane also contains a set of linked resources. These resources are tangential to the direct rendering. They include, for example, metadata records and links to external content (e.g., where to purchase an EPUB publication).
清單平面還包含一組鏈接的資源。這些資源與直接渲染相切。例如,它們包括元數據記錄和指向外部內容的連結(例如,在哪裡購買 EPUB 出版物)。

Unlike publication resources, they are not listed in the package document manifest (i.e., because they are not essential to rendering the EPUB publication). They are instead defined in link elements in the package document metadata. These elements define their nature and purpose similar to how manifest item elements define publication resource. (In this way, they are like an extension of the manifest.)
與發佈資源不同,它們未在包文檔清單中列出(即,因為它們對於呈現 EPUB 發佈不是必需的)。相反,它們在包文檔元數據的元素中 link 定義。這些元素定義其性質和用途,類似於清單 item 元素定義發佈資源的方式。(這樣,它們就像清單的擴展。

Refer to 5.5.7 The link element for more information about linked resources.
有關鏈接資源的更多資訊,請參閱 5.5.7 元素 link

Resources in the manifest plane are also sometimes broken down by where they are located. Although most publication resources have to be located in the EPUB container (called container resources), EPUB 3 allows audio, video, font and script data resources to be hosted outside the container. These exceptions were made to speed up the download and loading of EPUB publications, as these resources are typically quite large, and, in the case of fonts, not essential to the presentation. When remotely hosted, these publication resources are referred to as remote resources.
清單平面中的資源有時也會按它們所在的位置進行細分。儘管大多數發佈資源必須位於 EPUB 容器(稱為容器資源)中,但 EPUB 3 允許將音訊、視頻、字體和腳本數據資源託管在容器外部。這些例外是為了加快EPUB出版物的下載和載入速度,因為這些資源通常非常大,而且就字體而言,對演示文稿來說不是必需的。遠端託管時,這些發佈資源稱為遠端資源。

Since linked resources are not essential to the rendering of an EPUB publication, there are no requirements on where they are located and consequently no special naming of them based on their location. They may be located within the EPUB container or outside it.
由於鏈接的資源對於 EPUB 出版物的呈現不是必不可少的,因此對它們的位置沒有要求,因此沒有根據它們的位置對它們進行特殊命名。它們可能位於 EPUB 容器內或容器外部。

Note 注意

Hyperlinked content outside the EPUB container (e.g., web pages) are not publication resources, and consequently are not listed in the manifest. Reading systems will normally open these links in a separate browser instance, not as part of the EPUB publication.
EPUB 容器外部的超連結內容(例如,網頁)不是發佈資源,因此不會在清單中列出。閱讀系統通常會在單獨的瀏覽器實例中打開這些連結,而不是作為 EPUB 出版物的一部分。

3.1.2 The spine plane 3.1.2 脊柱平面

The spine plane defines resources used in the default reading order established by the spine, which includes both linear and non-linear content. The spine instructs reading systems on how to load these resources as the user progresses through the EPUB publication. Although many resources may be bundled in an EPUB container, they are not all allowed by default in the spine.
書脊平面定義了以書脊建立的默認閱讀順序使用的資源,其中包括線性和非線性內容。主幹指示閱讀系統如何在用戶流覽 EPUB 出版物時載入這些資源。儘管許多資源可能捆綁在 EPUB 容器中,但預設情況下,它們在主幹中並未全部被允許。

EPUB 3 defines a special class of resources called EPUB content documents that EPUB creators can use in the spine without any restrictions. EPUB content documents encompass both XHTML content documents and SVG content documents.
EPUB 3 定義了一類稱為 EPUB 內容文檔的特殊資源,EPUB 建立者可以在書脊中不受任何限制地使用這些資源。EPUB 內容文件包括 XHTML 內容文件和 SVG 內容文件。

To use any other type of resource in the spine, called a foreign content document, requires including a fallback to an EPUB content document. This extensibility model allows EPUB creators to experiment with formats while ensuring that reading systems are always able to render something for the user to read, as there is no guarantee of support for foreign content documents.
若要在主幹中使用任何其他類型的資源(稱為外部內容文檔),需要包含對 EPUB 內容文件的回退。此擴展性模型允許 EPUB 建立者試驗格式,同時確保閱讀系統始終能夠呈現供使用者閱讀的內容,因為無法保證支援外部內容文檔。

A mechanism called manifest fallbacks allows EPUB creators to provide fallbacks for foreign content documents. In this model, the manifest entry for the foreign content document must include a fallback attribute that points to the next possible resource for reading systems to try when they do not support its format. Although not common, a fallback resource can specify another fallback, thereby making chains many resources deep. The one requirement is that there must be at least one EPUB content document in a manifest fallback chain.
一種稱為清單回退的機制允許 EPUB 建立者為外部內容文檔提供回退。在此模型中,外部內容文檔的清單條目必須包含一個 fallback 屬性,該屬性指向下一個可能的資源,供閱讀系統在不支援其格式時嘗試。雖然不常見,但回退資源可以指定另一個回退,從而使許多資源鏈變得很深。一個要求是清單回退鏈中必須至少有一個 EPUB 內容文檔。

Although they are not directly listed in the spine, all of the resources in the fallback chain are considered part of the spine, and by extension part of the spine plane, since any may be used by a reading system.

Refer to 3.5.1 Manifest fallbacks for more information.
有關詳細資訊,請參閱 3.5.1 清單回退。

Caution 謹慎

Although manifest fallbacks fulfill the technical requirements of EPUB, there is little practical support for them in reading systems. Their use is strongly discouraged as it can lead to unreadable publications.
儘管 manifest 回退滿足 EPUB 的技術要求,但在讀取系統中幾乎沒有對它們的實際支援。強烈建議不要使用它們,因為它可能導致出版物不可讀。

Note 注意

It is possible to provide manifest fallbacks for EPUB content documents, but this is not required or common. For example, a scripted content document could have a fallback to an unscripted alternative for reading systems that do not support scripting.
可以為 EPUB 內容文件提供清單回退,但這不是必需的,也不常見。例如,腳本化內容文檔可以回退到不支援腳本的讀取系統的無腳本替代項。

3.1.3 The content plane 3.1.3 內容平面

The content plane classifies resources that are used when rendering EPUB content documents and foreign content documents. These types of resources include embedded media, CSS style sheets, scripts, and fonts. These resources fall into three categories based on their reading system support: core media type resources, foreign resources, and exempt resources.
內容平面對呈現EPUB內容文檔和外部內容文檔時使用的資源進行分類。這些類型的資源包括嵌入式媒體、CSS 樣式表、腳本和字體。這些資源根據其閱讀系統支持分為三類:核心媒體類型資源、外部資源和豁免資源。

A core media type resource is one that reading systems have to support, so it can be used without restriction in EPUB or foreign content documents. For more information about core media type resources, refer to 3.2 Core media types.
核心媒體類型資源是閱讀系統必須支持的資源,因此可以在 EPUB 或外部內容文檔中不受限制地使用它。有關核心介質類型資源的詳細資訊,請參閱 3.2 核心介質類型。

Note 注意

Being a core media type resource does not mean that reading systems will always render the resource, as not all reading systems support all features of EPUB 3. A reading system without a viewport, for example, will not render visual content such as images.
作為核心媒體類型資源並不意味著閱讀系統將始終呈現資源,因為並非所有閱讀系統都支援 EPUB 3 的所有功能。例如,沒有視口的閱讀系統將無法呈現圖像等視覺內容。

The opposite of core media type resources are foreign resources. These are resources that reading systems are not guaranteed to support the rendering of. As a result, similar to how using foreign content documents in the spine requires fallbacks to ensure their rendering, using foreign resources in content documents also requires fallbacks. These fallbacks are provided in one of two ways: using the capabilities of the host format or via manifest fallbacks.

The preferred method is to use the fallback capabilities of the host format. Many HTML elements, for example, have intrinsic fallback capabilities. One example is the picture element [html], which allows EPUB creators to specify multiple alternative image formats.
首選方法是使用主機格式的回退功能。例如,許多 HTML 元素都具有固有的回退功能。一個例子是 picture 元素 [ html],它允許 EPUB 建立者指定多種替代圖像格式。

If an intrinsic fallback method is not available, it is also possible to use manifest fallbacks, but this method, as cautioned against in the previous section, is discouraged. For more information about foreign resources, refer to 3.3 Foreign resources.
如果內部回退方法不可用,也可以使用清單回退,但如上一節中警告的那樣,不鼓勵使用此方法。有關外部資源的更多資訊,請參閱 3.3 外部資源。

Falling between core media type resources and foreign resources are exempt resources. These are most closely associated with foreign resources, as there is no guarantee that reading systems will render them. But like core media types, they do not require fallbacks.

Exempt resources tend to address specific cases for which there are no core media types defined, but for which providing a fallback would prove cumbersome or unnecessary. These include embedding video, adding accessibility tracks, and linking to resources from the [html] link element.
豁免資源傾向於解決未定義核心媒體類型的特定情況,但對於這些情況,提供回退將證明是繁瑣或不必要的。其中包括嵌入視頻、添加輔助功能軌道以及從 [ html] link 元素連結到資源。

Refer to 3.4 Exempt resources for more information about these exceptions.
有關這些例外的更多資訊,請參閱 3.4 豁免資源。

Note 注意

A common point of confusion arising from core media type resources is the listing of XHTML and SVG as core media type resources with the requirement the markup conform to their respective EPUB content document definitions. This allows EPUB creators to embed both XHTML and SVG documents in EPUB content documents while keeping consistent requirements for authoring and reading system support.
核心媒體類型資源引起的一個常見混淆點是將 XHTML 和 SVG 列為核心媒體類型資源,並要求標記符合其各自的 EPUB 內容文檔定義。這允許 EPUB 建立者在 EPUB 內容文件中嵌入 XHTML 和 SVG 文件,同時保持一致的創作和閱讀系統支援要求。

In practice, it means that EPUB creators can put XHTML and SVG core media type resources in the spine without any modification or fallback (they are also conforming XHTML and SVG content documents), but this is a unique case. All other core media type resources become foreign content documents when used in the spine (i.e., foreign content documents include all foreign resources and all core media type resources except for XHTML and SVG).
在實踐中,這意味著 EPUB 建立者可以將 XHTML 和 SVG 核心媒體類型資源放在書脊中,而無需任何修改或回退(他們也符合 XHTML 和 SVG 內容文檔),但這是一個獨特的案例。在主幹中使用時,所有其他核心媒體類型資源都將成為外部內容文檔(即,外部內容文檔包括除 XHTML 和 SVG 之外的所有外部資源和所有核心媒體類型資源)。

3.2 Core media types 3.2 核心媒體類型

EPUB creators MAY include publication resources that conform to the MIME media type [rfc2046] specifications defined in the following table without fallbacks when they are used in EPUB content documents and foreign content documents. These resources are classified as core media type resources.
EPUB 建立者可以包含符合下表中定義的 MIME 媒體類型 [ rfc2046] 規範的發佈資源,當它們在 EPUB 內容文檔和外部內容文檔中使用時,沒有回退。這些資源被歸類為核心媒體類型資源。

With the exception of XHTML content documents and SVG content documents, EPUB creators MUST provide manifest fallbacks for core media type resources referenced directly from the spine. In this case, they are foreign content documents.
除 XHTML 內容文件和 SVG 內容文件外,EPUB 建立者必須為直接從主幹引用的核心媒體類型資源提供清單回退。在本例中,它們是外來內容文檔。

The columns in the table represent the following information:

Media Type 介質類型 Content Type Definition 內容類型定義 Applies to 適用於
Images 圖像
image/gif [gif]  [ 動圖] GIF Images GIF圖片
image/jpeg [jpeg]  [ jpeg格式] JPEG Images JPEG 影像
image/png [png]  [ 巴布亞紐幾內亞] PNG Images PNG圖片
image/svg+xml SVG content documents
SVG 內容文件
SVG documents SVG 文件
image/webp [webp-container], [webp-lb]
[ webp-容器], [ webp-lb]
WebP Images WebP 圖片
Audio 音訊
audio/mpeg [mp3]  [ mp3 格式] MP3 audio MP3 音訊
audio/mp4 [mpeg4-audio], [mp4]
[ MPEG4-音訊], [ MP4]
AAC LC audio using MP4 container
使用 MP4 容器的 AAC LC 音訊
audio/ogg; codecs=opus [rfc7845] OPUS audio using OGG container
Style 風格
text/css CSS Style Sheets
CSS 樣式表
CSS Style Sheets. CSS 樣式表。
Fonts 字體
  1. font/ttf
  2. application/font-sfnt
[truetype]  [ 真型態] TrueType fonts TrueType 字體
  1. font/otf
  2. application/font-sfnt
  3. application/vnd.ms-opentype
[opentype] [ 開放類型] OpenType fonts OpenType 字體
  1. font/woff
  2. application/font-woff
[woff]  [ 沃夫] WOFF fonts WOFF 字體
font/woff2 [woff2]  [ 沃夫2] WOFF2 fonts WOFF2 字體
Other 其他
application/xhtml+xml XHTML content documents
XHTML 內容文件
HTML documents that use the XML syntax [html].
使用 XML 語法 [ html] 的 HTML 文件。
  1. application/javascript
  2. application/ecmascript
  3. text/javascript
[rfc4329] Scripts. 腳本。
application/x-dtbncx+xml [opf-201]  [ OPF-201型] The legacy NCX. 舊版 NCX。
application/smil+xml Media overlays 媒體疊加 EPUB media overlay documents
EPUB 媒體疊加文檔
Note 注意

Inclusion as a core media type resource does not mean that all reading systems will support the rendering of a resource. Reading system support also depends on the capabilities of the application (e.g., a reading system with a viewport must support image core media type resources, but a reading system without a viewport does not). Refer to Core media types [epub-rs-33] for more information about which reading systems rendering capabilities require support for which core media type resources.
作為核心媒體類型資源的包含並不意味著所有閱讀系統都支援資源的呈現。閱讀系統支援還取決於應用程式的功能(例如,具有視口的閱讀系統必須支援圖像核心媒體類型資源,而沒有視口的閱讀系統則不支援)。有關哪些讀取系統呈現功能需要支援哪些核心媒體類型資源的詳細資訊,請參閱核心媒體類型 [ epub-rs-33]。

The Working Group typically only includes formats as core media type resources when they have broad support in web browser cores — the rendering engines that EPUB 3 reading systems build upon. They are an agreement between reading system developers and EPUB creators to ensure the predictability of rendering of EPUB publications.
工作組通常只將格式作為核心媒體類型資源包含在 Web 瀏覽器核心(EPUB 3 閱讀系統構建的渲染引擎)中具有廣泛支援時。它們是閱讀系統開發人員和 EPUB 建立者之間的協定,旨在確保 EPUB 出版物呈現的可預測性。

3.3 Foreign resources 3.3 國外資源

A foreign resource, unlike a core media type resource is one which is not guaranteed reading system support when used in an EPUB content document or foreign content document.
與核心媒體類型資源不同,外部資源是在 EPUB 內容文件或外部內容文檔中使用時不保證閱讀系統支援的資源。

EPUB creators MUST provide fallbacks for foreign resources, where fallbacks take one of the following forms:
EPUB 建立者必須為外部資源提供回退,其中回退採用以下形式之一:

Note 注意

Refer to the [html] and [svg] specifications for the intrinsic fallback capabilities their elements provide.
請參閱 [ html] 和 [ svg] 規範,瞭解其元素提供的內在回退功能。

3.5.2 Intrinsic fallbacks also provides additional information about how fallbacks are interpreted for specific elements.
3.5.2 內部回退還提供了有關如何解釋特定元素的回退的附加資訊。

3.4 Exempt resources 3.4 豁免資源

An exempt resource shares properties with both foreign resources and core media type resources. It is most similar to a foreign resource in that it is not guaranteed reading system support, but, like a core media type resource, does not require a fallback.

There are only a small set of special cases for exempt resources. Video, for example, are exempt from fallbacks because there is no consensus on a core media type video format at this time (i.e., there is no format to fallback to). Similarly, audio and video tracks are exempt to allow EPUB creators to meet accessibility requirements using whatever format reading systems support best.
豁免資源只有一小部分特殊情況。例如,視頻免於回退,因為目前尚未就核心媒體類型視頻格式達成共識(即,沒有可回退到的格式)。同樣,音訊和視頻軌道也被豁免,以允許 EPUB 創作者使用閱讀系統支援的最佳格式來滿足可訪問性要求。

The following list details cases of content-specific exempt resources, including any restrictions on where EPUB creators can use them.
以下清單詳細介紹了特定於內容的豁免資源的情況,包括對 EPUB 建立者可以使用這些資源的任何限制。

Fonts 字體

All font resources not already covered as font core media types are exempt resources.

This exemption allows EPUB creators to use any font format without a fallback, regardless of reading system support expectations, as CSS rules will ensure a fallback font in case of no support.
此豁免允許 EPUB 建立者使用任何字體格式而無需回退,無論閱讀系統支援預期如何,因為 CSS 規則將確保在不支持的情況下使用回退字體。

Refer to the reading system support requirements for fonts [epub-rs-33] for more information.
有關詳細資訊,請參閱字體的閱讀系統支援要求 [ epub-rs-33]。

Tracks 軌道

All audio and video tracks (e.g., [webvtt] captions, subtitles and descriptions) referenced from the [htmltrack element are exempt resources.
從 [ html] track 元素引用的所有音訊和視頻軌道(例如,[ webvtt] 字幕、字幕和描述)都是豁免資源。

Video 視頻

All video codecs referenced from the [html] video — including any child source elements — are exempt resources.
從 [ html] video 引用的所有視頻編解碼器(包括任何子 source 元素)都是免稅資源。

Note 注意

Although reading systems are encouraged to support at least one of the H.264 [h264] and VP8 [rfc6386] video codecs, support for video codecs is not a conformance requirement. EPUB creators must consider factors such as breadth of adoption, playback quality, and technology royalties when deciding which video formats to include.
儘管鼓勵讀取系統至少支援 H.264 [h264] 和 VP8 [rfc6386] 視頻編解碼器之一,但對視頻編解碼器的支援不是一致性要求。EPUB 創作者在決定包含哪些視頻格式時,必須考慮採用範圍、播放品質和技術版稅等因素。

Note 注意

The exemptions made above do not apply to the spine. If an exempt resource is used in the spine, and it is not also an EPUB content document, it will require a fallback in that context.
上述豁免不適用於脊柱。如果在主幹中使用了豁免資源,並且它不是 EPUB 內容文檔,則需要在該上下文中進行回退。

In addition to the content-specific exemptions, a resource is classified as an exempt resource if:

This exemption allows EPUB creators to include resources in the EPUB container that are not for use by EPUB reading systems. The primary case for this exemption is to allow data files to travel with an EPUB publication, whether for scripts to use in their constituent EPUB content documents or for external applications to use (e.g., a scientific journal might include a data set with instructions on how to extract it from the EPUB container).
此豁免允許 EPUB 建立者在 EPUB 容器中包含不供 EPUB 讀取系統使用的資源。此豁免的主要情況是允許數據檔隨 EPUB 出版物一起傳輸,無論是用於在其組成 EPUB 內容文檔中的腳本,還是供外部應用程式使用(例如,科學期刊可能包含一個數據集,其中包含有關如何從 EPUB 容器中提取該數據集的說明)。

It also allows EPUB creators to use foreign resources in foreign content documents without reading systems or EPUB conformance checkers having to understand the fallback capabilities of those resources (i.e., the requirement for a fallback for the foreign content document covers any rendering issues within it). As the resource is not referenced from an EPUB content document, it automatically becomes exempt from fallbacks.
它還允許 EPUB 建立者在外部內容文檔中使用外部資源,而無需讀取系統或 EPUB 一致性檢查器瞭解這些資源的回退功能(即,對外部內容文檔的回退要求涵蓋其中的任何呈現問題)。由於資源不是從 EPUB 內容文件中引用的,因此它會自動免於回退。

3.5 Resource fallbacks 3.5 資源回退

3.5.1 Manifest fallbacks 3.5.1 清單回退

Manifest fallbacks are a feature of the package document that create a manifest fallback chain for a publication resource, allowing reading systems to select an alternative format they can render.

Fallback chains are created using the fallback attribute on manifest item elements. This attribute references the ID [xml] of another manifest item that is a fallback for the current item. The ordered list of all the references that a reading system can reach, starting from a given item's fallback attribute, represents the full fallback chain for that item. This chain also represents the EPUB creator's preferred fallback order.
回退鏈是使用清單 item 元素上的 fallback 屬性創建的。此屬性引用另一個清單的 ID [ xml] item ,該清單是當前 item .從給定 itemfallback 屬性開始,讀取系統可以訪問的所有引用的有序清單表示該 item 引用的完整回退鏈。此鏈還表示 EPUB 建立者的首選回退順序。

There are two cases for manifest fallbacks:

Spine fallbacks 脊柱回退

EPUB creators MUST specify a fallback chain for a foreign content document to ensure that reading systems can always render the spine item. In this case, the chain MUST contain at least one EPUB content document.
EPUB 建立者必須為外部內容文檔指定回退鏈,以確保閱讀系統始終可以呈現主幹專案。在這種情況下,鏈必須包含至少一個 EPUB 內容文件。

EPUB creators MAY provide fallbacks for EPUB content documents (e.g., to provide a fallback for scripted content).
EPUB 建立者可以為 EPUB 內容文件提供回退(例如,為腳本內容提供回退)。

When a fallback chain includes more than one EPUB content document, EPUB creators can use the properties attribute to differentiate the purpose of each.
當回退鏈包含多個 EPUB 內容文件時,EPUB 建立者可以使用該 properties 屬性來區分每個文檔的用途。

Content fallbacks 內容回退
Note 注意

The original purpose for content fallbacks was to specify fallback images for the [html] img element. As HTML now has intrinsic fallback mechanism for images, the use of content fallbacks is strongly discouraged. EPUB creators should always use the intrinsic fallback capabilities of [html] and [svg] to provide fallback content.
內容回退的最初目的是為 [ html] img 元素指定回退圖像。由於 HTML 現在具有圖像的內在回退機制,因此強烈建議不要使用內容回退。EPUB 建立者應始終使用 [ html] 和 [ svg] 的固有回退功能來提供回退內容。

EPUB creators MUST provide a content fallback for foreign resources when the elements that reference them do not have intrinsic fallback capabilities. In this case, the fallback chain MUST contain at least one core media type resource.
當引用 EPUB 的元素不具有內在回退功能時,EPUB 建立者必須為外部資源提供內容回退。在這種情況下,回退鏈必須包含至少一個核心媒體類型資源。

EPUB creators MAY also provide manifest fallbacks for core media type resources (e.g., to allow reading systems to select from more than one image format).
EPUB 建立者還可以為核心媒體類型資源提供清單回退(例如,允許閱讀系統從多種圖像格式中進行選擇)。

Regardless of the type of manifest fallback specified, fallback chains MUST NOT contain self-references or circular references to item elements in the chain.
無論指定的清單回退類型如何,回退鏈都不得包含對 item 鏈中元素的自引用或迴圈引用。

Note 注意

As it is not possible to use manifest fallbacks for resources represented in data URLs, EPUB creators can only represent foreign resources as data URLs where an intrinsic fallback mechanism is available.
由於無法對數據 URL 中表示的資源使用清單回退,因此 EPUB 建立者只能將外部資源表示為具有內在回退機制的數據 URL。

3.5.2 Intrinsic fallbacks
3.5.2 內在回退

The following sections provide additional clarifications about the intrinsic fallback requirements of specific elements.
以下各節提供了有關特定元素的內在回退要求的其他說明。 HTML audio and video fallbacks HTML audiovideo 回退

EPUB creators MUST NOT use embedded [htmlflow content within a media element (i.e, audio or video) as an intrinsic fallback for audio foreign resources. Only child source elements [html] provide intrinsic fallback capabilities.
EPUB 建立者不得使用媒體元素( audio 即 或 video )中嵌入的 [ html] 流內容作為音訊外部資源的內在回退。只有子 source 元素 [ html] 提供內在的回退功能。

Only older reading systems that do not recognize the audio or the video elements (e.g., EPUB 2 reading systems) will render the embedded content. When reading systems support these elements but not the available media formats, they do not render the embedded content for the user.
只有無法識別 audio 或 元素 video 的舊閱讀系統(例如 EPUB 2 閱讀系統)才會呈現嵌入的內容。當閱讀系統支援這些元素但不支援可用的媒體格式時,它們不會為使用者呈現嵌入的內容。

Note 注意

The requirement for fallbacks only applies to audio foreign resources referenced from audio and video elements. Fallbacks are not required for video resources; they are exempt resources.
回退要求僅適用於引用自 audiovideo 元素的音訊外部資源。視頻資源不需要回退;它們是豁免資源。 HTML img fallbacks HTML img 回退

Due to the variety of sources that EPUB creators can specify in the [html] img element, the following fallback conditions apply to its use:
由於 EPUB 建立者可以在 [ html] img 元素中指定各種源,因此以下回退條件適用於其使用:

  • If it is the child of a picture element:
    如果它是 picture 元素的子元素:

    • it MUST reference core media type resources from its src and srcset attributes, when EPUB creators specify those attributes; and
      當 EPUB 建立者指定核心媒體類型資源時,它必須從其 srcsrcset 屬性中引用核心媒體類型資源;和
    • each sibling source element MUST reference a core media type resource from its src and srcset attributes unless it specifies the MIME media type [rfc2046] of a foreign resource in its type attribute.
      每個同級 source 元素都必須從其 src and srcset 屬性引用核心媒體類型資源,除非它在其 type 屬性中指定了外部資源的 MIME 媒體類型 [ rfc2046]。
  • Otherwise, it MAY reference foreign resources in its src and srcset attributes provided EPUB creators define a manifest fallback.
    否則,如果 EPUB 建立者定義了清單回退,它可能會在其 srcsrcset 屬性中引用外部資源。 HTML script element HTML script 元素

Although data blocks have a separate MIME media type [rfc2046] from their containing XHTML content document, it is not possible to provide intrinsic fallbacks as no such mechanisms are specified for the [html] script element. It is also not possible to provide manifest fallbacks because data blocks cannot be defined as standalone files in the EPUB container but are always embedded as inline script elements.
儘管數據塊具有與其包含的 XHTML 內容文檔不同的 MIME 媒體類型 [ rfc2046],但無法提供內部回退,因為沒有為 [ html] script 元素指定此類機制。也無法提供清單回退,因為數據塊不能定義為 EPUB 容器中的獨立檔,而是始終作為內聯 script 元素嵌入。

But, as the script element does not represent user content — data blocks are not rendered unless manipulated by script, and content rendered by scripts already has core media type requirements — requiring fallbacks for the raw data does not serve a useful purpose.
但是,由於 script 元素不表示用戶內容(除非由腳本操作,否則不會呈現數據塊,並且腳本呈現的內容已經具有核心媒體類型要求),因此要求對原始數據進行回退並不能起到有用的作用。

Consequently, to ensure that EPUB creators can include data blocks for scripting purposes, they are exempt from fallback requirements.
因此,為了確保 EPUB 建立者可以包含用於腳本目的的數據塊,他們不受回退要求的約束。

Note 注意

This exemption aligns data blocks with the exemption for data files.

Note 注意

[svg] does not define data blocks as of publication, but the same exclusion would apply if a future update adds the concept.
[ svg] 在發佈時未定義數據塊,但如果將來的更新添加了該概念,則相同的排除將適用。

3.6 Resource locations 3.6 資源位置

EPUB creators MAY host the following types of publication resources outside the EPUB container:
EPUB 建立者可以在 EPUB 容器之外託管以下類型的發佈資源:

EPUB creators MUST store all other resources within the EPUB container.
EPUB 建立者必須將所有其他資源存儲在 EPUB 容器中。

Storing all resources inside the EPUB container is strongly encouraged whenever possible as it allows users access to the entire presentation regardless of connectivity status.
強烈建議盡可能將所有資源存儲在 EPUB 容器中,因為它允許使用者訪問整個演示文稿,而不管連接狀態如何。

When resources have to be located outside the EPUB container, EPUB creators are RECOMMENDED to reference them via the secure https URI scheme [rfc7230] to limit the threat of exposing their publications, and users, to network attacks. Reading systems might not load remote resources referenced using insecure schemes such as http.
當資源必須位於 EPUB 容器外部時,建議 EPUB 建立者通過安全 https URI 方案 [rfc7230] 引用它們,以限制將其發佈和使用者暴露於網路攻擊的威脅。讀取系統可能不會載入使用不安全機制(如 http .

These rules for locating publication resource apply regardless of whether the given resource is a core media type resource or a foreign resource.

Note 注意

Refer to the remote-resources property for more information on how to indicate that a manifest item references a remote resource.
有關如何指示清單 item 引用遠端資源的詳細資訊,請參閱該 remote-resources 屬性。

3.7 Data URLs 3.7 數據網址

The data: URL scheme [rfc2397] is used to encode resources directly into a URL string. The advantage of this scheme is that it allows EPUB creators to embed a resource within another, avoiding the need for an external file.
data: URL 方案 [ rfc2397] 用於將資源直接編碼為 URL 字串。此方案的優點是它允許 EPUB 建立者將資源嵌入到另一個資源中,從而避免了對外部檔的需求。

EPUB creators MUST NOT use data URLs in the following scenarios where they can result in a top-level content document or top-level browsing context [html]:
EPUB 建立者不得在以下情況下使用數據 URL,因為數據 URL 可能會導致頂級內容文檔或頂級流覽上下文 [ html]:

Note 注意

These restrictions on the use of data URLs are to prevent security issues and also to ensure that reading systems can determine where to take a user next (i.e., because data URLs cannot be referenced from the spine).
這些對數據 URL 使用的限制是為了防止安全問題,也是為了確保讀取系統可以確定使用者下一步要去哪裡(即,因為無法從主幹引用數據 URL)。

The list of prohibited uses for data URLs is subject to change as the respective standards that allow their use evolve.
數據 URL 的禁止使用清單可能會隨著允許其使用的相應標準的發展而更改。

A consequence of embedding is that the data in a data URL is not considered its own unique publication resource for manifest reporting purposes (i.e., only its containing publication resource gets listed). As this data has its own media type, however, it is still subject to foreign resource restrictions. EPUB creators MUST therefore encode data URLs as core media type resources or provide a fallback using the intrinsic fallback mechanisms of the host format.
嵌入的後果是,出於清單報告目的,數據 URL 中的數據不被視為其自己的唯一發佈資源(即,僅列出其包含的發佈資源)。但是,由於此數據具有自己的媒體類型,因此仍受外部資源限制。因此,EPUB 建立者必須將數據 URL 編碼為核心媒體類型資源,或者使用主機格式的固有回退機制提供回退。

3.8 File URLs 3.8 檔網址

The file: URL scheme is defined in [rfc8089] as "identifying an object (a 'file') stored in a structured object naming and accessing environment on a host (a 'file system')." It is typically used to retrieve files from the local operating system.
file: URL 方案在 [ rfc8089] 中定義為“標識存儲在主機('文件系統')上的結構化物件命名和訪問環境中的物件('檔')。它通常用於從本地作業系統檢索檔。

Using a file URL in an EPUB publication, which can be transferred among different hosts, represents a security risk and is also non-interoperable. As a consequence, EPUB creators MUST NOT use file URLs in EPUB publications.
在 EPUB 發佈中使用可在不同主機之間傳輸的檔 URL 存在安全風險,並且不可互操作。因此,EPUB 建立者不得在 EPUB 出版物中使用檔 URL。

3.9 XML conformance 3.9 XML一致性

Any publication resource that is an XML-based media type [rfc2046]:
任何基於 XML 的媒體類型的發佈資源 [ rfc2046]:

The above constraints apply regardless of whether the given publication resource is a core media type resource or a foreign resource.

Note 注意

[html] and [svg] are removing support for the XML base attribute [xmlbase]. EPUB creators should avoid using this feature.
[ html] 和 [ svg] 將刪除對 XML base 屬性 [ xmlbase] 的支援。EPUB 建立者應避免使用此功能。

4. Open Container Format (OCF)
4. 開放容器格式 (OCF)

4.1 Introduction 4.1 引言

This section is non-normative.

OCF is the required container technology for EPUB publications. OCF may play a role in the following workflows:
OCF 是 EPUB 出版物所需的容器技術。OCF 可能在以下工作流程中發揮作用:

This section defines the rules for structuring the file collection in the abstract: the "abstract container". It also defines the rules for the representation of this abstract container within a ZIP archive: the "physical container". The rules for ZIP physical containers build upon the ZIP technologies used by [odf].
本節定義了在抽象中構建檔集合的規則:“抽象容器”。它還定義了在ZIP存檔中表示此抽象容器的規則:「物理容器」。ZIP 物理容器的規則建立在 [ odf] 使用的 ZIP 技術之上。

OCF also defines a standard method for obfuscating embedded fonts for those EPUB publications that require this functionality.
OCF 還定義了一種標準方法,用於對需要此功能的 EPUB 出版物的嵌入字體進行模糊處理。

4.2 OCF abstract container
4.2 OCF抽象容器

4.2.1 Introduction 4.2.1 簡介

This section is non-normative.

The OCF abstract container file system model uses a single common root directory. All container resources are located within the directory tree headed by the root directory, but no specific file system structure for them is mandated by this specification.
OCF 抽象容器文件系統模型使用單個公共根目錄。所有容器資源都位於以根目錄為首的目錄樹中,但此規範沒有強制要求它們具有特定的檔系統結構。

The file system model also includes a mandatory directory named META-INF that is a direct child of the root directory and stores the following special files:
檔案系統模型還包括一個名為 META-INF root 目錄的直接子目錄的必需目錄,並儲存以下特殊檔:

container.xml [required]

Identifies one or more package documents that define the EPUB publication.
標識定義 EPUB 發佈的一個或多個包文檔。

signatures.xml [optional]

Contains digital signatures for various assets.

encryption.xml [optional]

Contains information about the encryption of publication resources. This file is mandatory when EPUB creators use font obfuscation.
包含有關發佈資源加密的資訊。當 EPUB 建立者使用字體混淆時,此檔是必需的。

metadata.xml [optional]

Used to store metadata about the OCF ZIP container.
用於存儲有關OCF ZIP容器的元數據。

rights.xml [optional]

Used to store information about digital rights.

manifest.xml [optional]

A manifest of container contents as allowed by Open Document Format [odf].
打開文件格式 [ odf] 允許的容器內容清單。

Refer to 4.2.6 META-INF directory for conformance requirements for the various files in the META-INF directory.
請參閱 4.2.6 META-INF 目錄,了解 META-INF 目錄中各種檔的一致性要求。

4.2.2 File and directory structure
4.2.2 檔和目錄結構

The virtual file system for the OCF abstract container MUST have a single common root directory for all the contents of the container.
OCF 抽象容器的虛擬文件系統必須具有容器所有內容的單個公共根目錄。

The OCF abstract container MUST include a directory for configuration files named META-INF that is a direct child of the container's root directory. Refer to 4.2.6 META-INF directory for the requirements for the contents of this directory.
OCF 抽象容器必須包含一個名為 META-INF 容器根目錄的直接子目錄的配置文件目錄。有關此目錄內容的要求,請參閱 4.2.6 META-INF 目錄。

The file name mimetype in the root directory is reserved for use by OCF ZIP containers, as explained in 4.3 OCF ZIP container.
根目錄中的檔名 mimetype 保留供 OCF ZIP 容器使用,如 4.3 OCF ZIP 容器中所述。

Files in the META-INF directory and the mimetype file are not publication resources so MUST NOT be listed in the manifest.
META-INF 目錄中的文件和 mimetype 檔不是發佈資源,因此不得在清單中列出。

EPUB creators MAY locate all other files within the OCF abstract container in any location descendant from the root directory, provided they are not within the META-INF directory. EPUB creators MUST NOT reference files in the META-INF directory from an EPUB publication.
EPUB 建立者可以在根目錄的任何位置找到 OCF 抽象容器中的所有其他檔,前提是它們不在目錄中 META-INF 。EPUB 建立者不得引用 EPUB 出版物目錄 META-INF 中的檔。

Note 注意

Some reading systems do not provide access to resources outside the directory where the package document is stored. EPUB creators should therefore place all resources at or below the directory containing the package document to avoid interoperability issues.
某些讀取系統不提供對存儲包文檔的目錄之外的資源的訪問。因此,EPUB 建立者應將所有資源放在包含包文檔的目錄或目錄下方,以避免互操作性問題。

This problem is more commonly encountered when creating multiple renditions [epub-multi-rend-11] of the publication.
在創建出版物的多個演繹版 [ epub-multi-rend-11] 時,更常遇到此問題。

4.2.3 File paths and file names
4.2.3 檔路徑和檔名

In the context of the OCF abstract container, file paths and file names are scalar value strings [infra] (i.e., their values are case sensitive).
在 OCF 抽象容器的上下文中,檔路徑和檔名是標量值字串 [ infra](即,它們的值區分大小寫)。

In addition, the following restrictions are designed to allow file paths and file names to be used without modification on most operating systems:

  • File names MUST NOT exceed 255 bytes.
    檔名不得超過 255 個字節。

  • The file paths for any directory or file within the OCF abstract container MUST NOT exceed 65535 bytes.
    OCF 抽象容器中任何目錄或文件的檔路徑不得超過65535位元組。

  • File names MUST NOT use the following [unicode] characters, as commonly used operating systems may not support these characters consistently:
    檔名不得使用以下 [ unicode] 字元,因為常用的作業系統可能無法一致地支持這些字元:

    • SOLIDUS: / (U+002F)
      固相線: /U+002F

    • QUOTATION MARK: " (U+0022)
      引號: "U+0022

    • ASTERISK: * (U+002A)
      ASTERISK: *U+002A

    • FULL STOP as the last character: . (U+002E)
      最後一個字元為句號: .U+002E

    • COLON: : (U+003A)
      冒號: :U+003A

    • LESS-THAN SIGN: < (U+003C)
      小於號: <U+003C

    • GREATER-THAN SIGN: > (U+003E)
      大於符號: >U+003E

    • QUESTION MARK: ? (U+003F)
      問號: ?U+003F

    • REVERSE SOLIDUS: \ (U+005C)
      反向固相線: \U+005C

    • VERTICAL LINE: | (U+007C)
      垂直線: |U+007C

    • DEL (U+007F) 德爾 ( U+007F

    • C0 range (U+0000 … U+001F)
      C0 範圍 ( U+0000 … U+001F

    • C1 range (U+0080 … U+009F)
      C1 範圍 ( U+0080 … U+009F

    • Private Use Area (U+E000 … U+F8FF)
      私人使用區 ( U+E000 … U+F8FF

    • All Unicode Non Characters, specifically:
      所有 Unicode 非字元,特別是:

      • The 32 contiguous characters in the Basic Multilingual Plane (U+FDD0 … U+FDEF)
        基本多語言平面 ( U+FDD0 … U+FDEF ) 中的 32 個連續字元

      • The last two code points of the Basic Multilingual Plane (U+FFFE and U+FFFF)
        基本多語言平面的最後兩個代碼點 ( U+FFFEU+FFFF

      • The last two code points at the end of the Supplementary Planes (U+1FFFE, U+1FFFF … U+EFFFE, U+EFFFF)
        補充平面末尾的最後兩個碼位 ( U+1FFFE, U+1FFFF … U+EFFFE, U+EFFFF

    • Specials (U+FFF0 … U+FFFF) 特價商品 ( U+FFF0 … U+FFFF

    • Supplementary Private Use Area-A (U+F0000 … U+FFFFF)
      補充私人使用區-A ( U+F0000 … U+FFFFF

    • Supplementary Private Use Area-B (U+100000 … U+10FFFF)
      補充私人使用區-B ( U+100000 … U+10FFFF

    Note 注意

    The Unicode Character Database [uax44] also includes a list of deprecated characters. EPUB creators are advised to avoid these characters, as well, as it is expected that EPUB conformance checkers will flag their use.
    Unicode 字元資料庫 [ uax44] 還包括已棄用字元的清單。建議 EPUB 建立者也避免使用這些字元,因為預計 EPUB 一致性檢查器會標記它們的使用。

  • For compatibility with older reading systems, file names SHOULD NOT contain SPACE (U+0020) characters.
    為了與較舊的讀取系統相容,檔名不應包含空格 (U+0020) 字元。

  • All file names within the same directory MUST be unique following Unicode canonical normalization [uax15] and then full case folding [unicode]. (Refer to Unicode Canonical Case Fold Normalization Step [charmod-norm] for more information.)
    同一目錄中的所有檔名必須是唯一的,遵循 Unicode 規範化 [uax15],然後全寫摺疊 [unicode]。(有關詳細資訊,請參閱 Unicode 規範大小寫摺疊規範化步驟 [charmod-norm]。

Note 注意

If EPUB creators dynamically integrate resources (i.e., where the naming is beyond their control), they should be aware that automatic truncation of file names to keep them within the 255 bytes limit can lead to corruption. This is due to the difference between bytes and characters in multibyte encodings such as UTF-8; it is, therefore, important to avoid mid-character truncation. See the section on "Truncating or limiting the length of strings" in [international-specs] for more information.
如果 EPUB 建立者動態整合資源(即,命名超出其控制範圍),他們應該意識到自動截斷檔名以使其保持在 255 位元組限制內可能會導致損壞。這是由於多位元組編碼(如UTF-8)中的位元組和字元之間的差異;因此,避免中間字元截斷非常重要。有關詳細資訊,請參閱 [ international-specs] 中有關“截斷或限制字符串長度”的部分。

Note 注意

EPUB creators should use an abundance of caution in their file naming when interoperability of content is key. The list of restricted characters is intended to help avoid some known problem areas, but it does not ensure that all other Unicode characters are supported. Although Unicode support is much better now than in earlier iterations of EPUB, older tools and toolchains may still be encountered (e.g., ZIP tools that only support [us-ascii]).
當內容的互操作性是關鍵時,EPUB 建立者在檔命名時應非常謹慎。受限制字元清單旨在説明避免某些已知問題區域,但不能確保支援所有其他 Unicode 字元。儘管現在對 Unicode 的支援比 EPUB 的早期反覆運算要好得多,但仍可能遇到較舊的工具和工具鏈(例如,僅支援 [us-ascii] 的 ZIP 工具)。

4.2.4 Deriving file paths
4.2.4 派生文件路徑

To derive the file path, given a file or directory file in the OCF abstract container, apply the following steps (expressed using the terminology of [infra]):
要派生文件路徑,給定 OCF 抽象容器中的文件或目錄檔,請應用以下步驟(使用 [ infra] 的術語表示):

  1. Let path be an empty list.
  2. Let current be file. 讓 current 成為檔。
  3. While current is not the root directory:
    雖然 current 不是根目錄:
    1. prepend the file name of current to path;
      將 current 的檔名前置到 path;
    2. set current to the parent directory of current.
      將 Current 設定為 Current 的父目錄。
  4. Return the concatenation of path using the U+002F (/) character.
    使用 U+002F (/) 字元返回路徑的串聯。

4.2.5 URLs in the OCF abstract container
4.2.5 OCF 抽象容器中的URL

The container root URL is the URL [url] of the root directory. It is implementation-specific, but EPUB creators MUST assume it has the following properties:
容器根 URL 是根目錄的 URL [ url]。它是特定於實現的,但 EPUB 建立者必須假定它具有以下屬性:

The content URL of a file or directory in the OCF abstract container is the result of parsing the file's file path with the container root URL as base.
OCF 抽象容器中檔或目錄的內容 URL 是以容器根 URL 為基檔路徑解析檔路徑的結果。

Note 注意

The container root URL is the URL assigned by the reading system to the root of the EPUB container. It typically depends on how the reading system internally implements the container file system.
容器根 URL 是讀取系統分配給 EPUB 容器根目錄的 URL。這通常取決於讀取系統如何在內部實現容器文件系統。

However, a reading system cannot arbitrarily use any URL, but one that honors the constraints defined above. These constraints ensure that any relative URL string found in the EPUB will always be parsed to a URL of a resource within the container (which may or may not exist). The primary reason for these constraints is to avoid potential run-time security issues that would be caused by parsed URLs "leaking" outside the container files.
但是,讀取系統不能任意使用任何 URL,而只能使用遵循上述約束的 URL。這些約束可確保在 EPUB 中找到的任何相對 URL 字串將始終分析為容器中資源的 URL(可能存在也可能不存在)。這些約束的主要原因是避免潛在的運行時安全問題,這些問題是由分析的 URL 在容器檔外部「洩漏」引起的。

For example, URLs like https://localhost:12345/ or https://www.example.org:12345/ honor these properties. But URLs like https://localhost:12345/path/to.epub/, file:///path/to.epub#path=/, or jar:file:/path/to.epub!/EPUB/ do not (parsing the URL string ".." with these three examples as base would return https://localhost:12345/path/, file:///path/, and a parsing error, respectively). It is the responsibility of the reading system to assign a URL to the root directory that complies with the properties defined above.
例如,URL 喜歡 https://localhost:12345/https://www.example.org:12345/ 支援這些屬性。但是像、 或 不這樣的 https://localhost:12345/path/to.epub/ URL(以這三個範例為基礎解析 URL 字串 ' .. “ 將分別傳回 https://localhost:12345/path/file:///path/ 和解析 jar:file:/path/to.epub!/EPUB/ 錯誤)。 file:///path/to.epub#path=/ 讀取系統負責為根目錄分配符合上述定義屬性的 URL。

Note 注意

Parsing may replace some characters in the file path by their percent encoded alternative. For example, A/B/C/file name.xhtml becomes A/B/C/file%20name.xhtml.
解析可能會將文件路徑中的某些字元替換為其百分比編碼的替代字元。例如, A/B/C/file name.xhtml 變為 A/B/C/file%20name.xhtml .

A string url is a valid-relative-ocf-URL-with-fragment string if it is a path-relative-scheme-less-url string, optionally followed by U+0023 (#) and a url-fragment string, and if the following steps return true:
如果字串 url 是 path-relative-scheme-less-url 字串,則該字串是 valid-relative-ocf-URL-with-fragment 字符串,可以選擇後跟 U+0023 (#) 和 url-fragment 字符串,並且如果以下步驟返回 true:

  1. Set the container root URL to https://a.example.org/A/.
    將容器根 URL 設定為 https://a.example.org/A/

    Explanation 解釋

    The goal of the algorithm is to detect whether url could be seen as "leaking" outside the container. To do that, the standard URL parsing algorithm is used with an artificial root URL; the detection of the "leak" is done by comparing the result of the parsing with the presence of the first test path segment (A). (Note that the artificial container root URL wilfully violates, for the purpose of this algorithm, the required properties by using that first test path segment.)

  2. Let base be the base URL that must be used to parse url as defined by the context (document or environment) where url is used, and according to the content URL of the package document (see 5.2 Parsing URLs in the package document).
    設base為必須用於解析 url 的基 URL,該 URL 由使用 url 的上下文(文檔或環境)定義,並根據包文檔的內容 URL(參見 5.2 解析包文檔中的 URL)。

    Explanation 解釋

    In the case of a URL in the package document the base variable is set to the content URL of the package document. In the case of a document within the META-INF directory, the base variable is set to the container root URL (see Parsing URLs in the META-INF directory). In the case of a URL in an XHTML content document, the base URL used for parsing is defined by the HTML standard. Typically, it will be the content URL of the content document (unless the discouraged base element is used).

  3. Let testURLRecord be the result of applying the URL parser to url, with base.
    讓 testURLRecord 是將 URL 解析器應用於 url 的結果,帶有 base。
  4. Let testURLStringA be the result of applying the URL Serializer to testURLRecord.
    讓 testURLStringA 是將 URL 序列化程式應用於 testURLRecord 的結果。
  5. Set the container root URL to https://b.example.org/B/.
    將容器根 URL 設定為 https://b.example.org/B/

    Explanation 解釋

    The reasons to repeat the same steps twice with different, and artificial, settings of the container root URL is to avoid collision which may occur if the url string also includes /A/. Consider, for example, the case where url is ../../A/doc.xhtml.

  6. Set base to be the base URL that must be used to parse url as defined by the context (document or environment) where url is used, and according to the content URL of the package document (see 5.2 Parsing URLs in the package document).
    將base設置為必須用於解析 url 的基 URL,該 URL 由使用 url 的上下文(文檔或環境)定義,並根據包文檔的內容 URL(參見 5.2 解析包文檔中的 URL)。
  7. Set testURLRecord to be the result of applying the URL parser to url, with base.
    將 testURLRecord 設置為將 URL 解析器應用於 url 的結果,並帶有 base。
  8. Let testURLStringB be the result of applying the URL Serializer to testURLRecord.
    讓 testURLStringB 是將 URL 序列化程式應用於 testURLRecord 的結果。
  9. If testURLStringA does not start with https://a.example.org/ or testURLStringB does not start with https://b.example.org/, return true.
    如果 testURLStringA 不以 開頭 https://a.example.org/ ,或者 testURLStringB 不以 https://b.example.org/ 開頭,則返回 true。

    Explanation 解釋

    If any of the result does not share the test URL host, it means that url, or its base URL (for example, in HTML, if it is explicitly set with the base element), was absolute and points outside the container. This is acceptable.

  10. If testURLStringA starts with https://a.example.org/A/ and testURLStringB starts with https://b.example.org/B/, return true.
    如果 testURLStringA 以 開頭 https://a.example.org/A/ ,而 testURLStringB 以 https://b.example.org/B/ 開頭,則返回 true。

    Explanation 解釋

    The presence of the first test path segments (A, respectively B) indicate that the URL doesn't leak outside the container.

  11. Return false. 返回 false。

In the OCF abstract container, any URL string MUST be an absolute-url-with-fragment string or a valid-relative-ocf-URL-with-fragment string.
在 OCF 抽象容器中,任何 URL 字串都必須是 absolute-url-with-fragment 字串或 valid-relative-ocf-URL-with-fragment 字符串。

In addition, all relative-URL-with-fragment strings [url] MUST, after parsing, be equal to the content URL of an existing file in the OCF abstract container.
此外,所有 relative-URL-with-fragment 字串 [ url] 在解析後必須等於 OCF 抽象容器中現有檔的內容 URL。

Note 注意

These constraints on URL strings mean that:
這些對 URL 字串的約束意味著:

  • relative URL strings starting with a / (U+002F) (for example, /EPUB/content.xhtml) are disallowed;
    不允許使用 /U+002F ) 開頭的相對 URL 字串(例如 /EPUB/content.xhtml );
  • relative URL strings containing more double-dot URL path segments than needed to reach the target file (for example, EPUB/../../../../config.xml) are disallowed;
    不允許使用包含比到達目標檔所需的更多的雙點 URL 路徑段的相對 URL 字串(例如 EPUB/../../../../config.xml );
  • any other absolute or relative URL string is allowed.
    允許使用任何其他絕對或相對 URL 字串。

Note that in any case, even the disallowed URL strings described above will not "leak" outside the container after parsing (as explained in the first note of this section). They are nevertheless disallowed for better interoperability with non-conforming or legacy reading systems and toolchains.
請注意,在任何情況下,即使是上述不允許的 URL 字串也不會在解析后「洩漏」到容器外部(如本節的第一個註釋中所述)。然而,為了與不合規或遺留的閱讀系統和工具鏈有更好的互操作性,它們被禁止使用。

4.2.6 META-INF directory
4.2.6 META-INF 目錄 Inclusion in OCF abstract container 包含在 OCF 抽象容器中

All OCF abstract containers MUST include a directory called META-INF in their root directory.
所有OCF抽象容器都必須包含在其根目錄中調用 META-INF 的目錄。

This directory is reserved for configuration files, specifically those defined in Reserved files.
此目錄是為配置檔保留的,特別是 保留檔中定義的檔。 Parsing URLs in the META-INF directory 解析 META-INF 目錄中的URL

To parse a URL string url used in files located in the META-INF directory the URL parser MUST be applied to url, with the container root URL as base.
若要分析位於 META-INF 目錄中的檔中使用的URL字串url,必須將URL解析器應用於url,並將容器根URL作為基礎。 Reserved files 保留檔 Container file (container.xml) 容器檔 ( container.xml

The REQUIRED container.xml file in the META-INF directory identifies the package documents available in the OCF abstract container.
META-INF 目錄中的 REQUIRED container.xml 檔標識 OCF 抽象容器中可用的包文檔。

All [xml] elements defined in this section are in the urn:oasis:names:tc:opendocument:xmlns:container namespace [xml-names] unless specified otherwise.
除非另有說明,否則本節中定義的所有 [ xml] 元素都位於 urn:oasis:names:tc:opendocument:xmlns:container 命名空間 [ xml-names] 中。

The contents of this file MUST be valid to the definition in this section after removing all elements and attributes from other namespaces (including all attributes and contents of such elements).

Note 注意

An XML Schema also informally defines the content of this file.
XML 架構還非正式地定義此文件的內容。 The container element container 元素

The container element encapsulates all the information in the container.xml file.
container 元素封裝 container.xml 檔中的所有資訊。

Element Name: 元素名稱:


Usage: 用法:

REQUIRED root element [xml] of the container.xml file.
container.xml 檔的 REQUIRED 根元素 [ xml]。

Attributes: 屬性:
version [required]
This attribute MUST have the value "1.0".
此屬性必須具有值 “ 1.0
Content Model: 內容模型:

In this order: 依此順序: The rootfiles element rootfiles 元素

The rootfiles element contains a list of package documents available in the EPUB container.
rootfiles 元素包含EPUB容器中可用的包文檔清單。

Element Name: 元素名稱:


Usage: 用法:

REQUIRED first child of container.
必需的第一個子項 container

Attributes: 屬性:

None 沒有

Content Model: 內容模型: The rootfile element rootfile 元素

Each rootfile element identifies the location of one package document in the EPUB container.
每個 rootfile 元素標識一個包文檔在 EPUB 容器中的位置。

Element Name: 元素名稱:


Usage: 用法:

As child of the rootfiles element. Repeatable.
作為 rootfiles 元素的子元素。重複。

Attributes: 屬性:
full-path [required]

Identifies the location of a package document.

The value of the attribute MUST be a path-relative-scheme-less-URL string [url]. The path is relative to the root directory.
屬性的值必須是 path-relative-scheme-less-URL 字符串 [ url]。路徑相對於根目錄。

media-type [required]

Identifies the media type of the package document.

The value of the attribute MUST be "application/oebps-package+xml".
屬性的值必須是 “ application/oebps-package+xml ” ”

Content Model: 內容模型:


If an EPUB creator defines more than one rootfile element, each MUST reference a package document that conforms to the same version of EPUB. Each package document represents one rendering of the EPUB publication.
如果 EPUB 建立者定義了多個 rootfile 元素,則每個元素都必須引用符合相同版本的 EPUB 的包文檔。每個包文檔表示 EPUB 出版物的一個呈現形式。

Note 注意

Although the EPUB container provides the ability to reference more than one package document, this specification does not define how to interpret, or select from, the available options. Refer to [epub-multi-rend-11] for more information on how to bundle more than one rendering of the content.
儘管 EPUB 容器提供了引用多個包文檔的功能,但此規範並未定義如何解釋可用選項或從中進行選擇。請參閱 [ epub-multi-rend-11] 以獲取有關如何捆綁多個內容呈現的更多資訊。 Examples 示例

This section is non-normative.
本節是非規範性的。 Encryption file (encryption.xml) 加密檔案 ( encryption.xml

The OPTIONAL encryption.xml file in the META-INF directory holds all encryption information on the contents of the container. If an EPUB creator encrypts any resources within the container, they MUST include an encryption.xml file to provide information about the encryption used.
META-INF 目錄中的 OPTIONAL encryption.xml 檔保存有關容器內容的所有加密資訊。如果 EPUB 建立者對容器中的任何資源進行加密,則它們必須包含一個 encryption.xml 檔來提供有關所用加密的資訊。 The encryption element encryption 元素
Element Name: 元素名稱:


Namespace: 命名空間:


Usage: 用法:

REQUIRED root element [xml] of the encryption.xml file.
encryption.xml 檔的 REQUIRED 根元素 [ xml]。

Attributes: 屬性:

None 沒有

Content Model: 內容模型:

In any order: 按任意順序:

  • EncryptedKey [1 or more]  EncryptedKey [1個以上]
  • EncryptedData [1 or more]  EncryptedData [1個以上]

The encryption element contains child elements of type EncryptedKey and EncryptedData as defined by [xmlenc-core1].
encryption 元素包含類型 EncryptedKey EncryptedData 為 [ xmlenc-core1] 的子元素。

An EncryptedKey element describes each encryption key used in the container, while an EncryptedData element describes each encrypted file. Each EncryptedData element refers to an EncryptedKey element, as described in XML Encryption.
元素 EncryptedKey 描述容器中使用的每個加密密鑰,而元素 EncryptedData 描述每個加密檔。每個 EncryptedData 元素都引用一個 EncryptedKey 元素,如 XML 加密中所述。

Note 注意

An XML Schema also informally defines the content of the encryption.xml file.
XML 架構還非正式地定義 encryption.xml 文件的內容。

OCF encrypts individual files independently, trading off some security for improved performance, allowing the container contents to be incrementally decrypted. Encryption in this way exposes the directory structure and file naming of the whole package.
OCF 獨立加密單個文件,犧牲一些安全性來提高性能,允許以增量方式解密容器內容。以這種方式加密會公開整個包的目錄結構和檔命名。

OCF uses XML Encryption [xmlenc-core1] to provide a framework for encryption, allowing a variety of algorithms to be used. XML Encryption specifies a process for encrypting arbitrary data and representing the result in XML. Even though an OCF abstract container may contain non-XML data, EPUB creators can use XML Encryption to encrypt all data in an OCF abstract container. OCF encryption supports only the encryption of entire files within the container, not parts of files. EPUB creators MUST NOT encrypt the encryption.xml file when present.
OCF 使用 XML 加密 [ xmlenc-core1] 來提供加密框架,允許使用各種演算法。XML 加密指定用於加密任意資料並以 XML 表示結果的過程。儘管 OCF 抽象容器可能包含非 XML 數據,但 EPUB 建立者可以使用 XML 加密來加密 OCF 抽象容器中的所有數據。OCF 加密僅支援對容器內的整個文件進行加密,而不支援對部分文件進行加密。EPUB 建立者不得在檔存在時加密 encryption.xml 檔。

Encrypted data replaces unencrypted data in an OCF abstract container. For example, if an EPUB creator encrypts an image named photo.jpeg, they should replace the contents of the photo.jpeg resource with its encrypted contents. Within the ZIP directory, EPUB creators SHOULD store encrypted files rather than Deflate-compress them.
加密數據將替換 OCF 抽象容器中的未加密數據。例如,如果 EPUB 建立者對名為 photo.jpeg 的映像進行加密,則應將 photo.jpeg 資源的內容替換為其加密內容。在 ZIP 目錄中,EPUB 建立者應儲存加密檔,而不是對其進行 Deflate-compress。

Note that some situations require obfuscating the storage of embedded fonts referenced by an EPUB publication to make them more difficult to extract for unrestricted use. Although obfuscation is not encryption, reading systems use the encryption.xml file in conjunction with the font obfuscation algorithm to identify fonts to deobfuscate.
請注意,在某些情況下,需要對 EPUB 出版物引用的嵌入字體的存儲進行模糊處理,以使其更難提取以供不受限制地使用。儘管混淆不是加密,但讀取系統將 encryption.xml 檔與字體混淆演算法結合使用,以識別要反混淆的字體。

EPUB creators MUST NOT encrypt the following files:
EPUB 建立者不得加密以下檔案:

  • mimetype
  • META-INF/container.xml
  • META-INF/encryption.xml
  • META-INF/manifest.xml
  • META-INF/metadata.xml
  • META-INF/rights.xml
  • META-INF/signatures.xml
  • [= package document =]

EPUB creators MAY subsequently encrypt signed resources using the Decryption Transform for XML Signature [xmlenc-decrypt]. This feature enables a reading system to distinguish data encrypted before signing from data encrypted after signing.
EPUB 建立者隨後可以使用 XML 簽名的解密轉換 [xmlenc-decrypt] 對簽名資源進行加密。此功能使讀取系統能夠區分簽名前加密的數據和簽名后加密的數據。 Order of compression and encryption 壓縮和加密的順序

When stored in an OCF ZIP container, EPUB creators SHOULD compress streams of data with non-codec content types before encrypting them. EPUB creators MUST use Deflate compression. This practice ensures that file entries stored in the ZIP container have a smaller size.
當存儲在OCF ZIP容器中時,EPUB建立者應該在加密之前壓縮具有非編解碼器內容類型的數據流。EPUB 建立者必須使用Deflate壓縮。這種做法可確保存儲在 ZIP 容器中的檔條目具有較小的大小。

EPUB creators SHOULD NOT compress streams of data with codec content types before encrypting them. In such cases, additional compression introduces unnecessary processing overhead at production time (especially with large resource files) and impacts audio/video playback performance at consumption time. In some cases, the combination of compression with some encryption schemes might even compromise the ability of reading systems to handle partial content requests (e.g. HTTP byte ranges), due to the technical impossibility to determine the length of the full resource ahead of media playback (e.g. HTTP Content-Length header).
EPUB 建立者在加密之前不應使用編解碼器內容類型壓縮數據流。在這種情況下,額外的壓縮會在生產時引入不必要的處理開銷(尤其是對於大型資源檔),並影響使用時的音訊/視頻播放性能。在某些情況下,壓縮與某些加密方案的結合甚至可能損害讀取系統處理部分內容請求(例如 HTTP 位元組範圍)的能力,因為在媒體播放之前(例如 HTTP Content-Length 標頭)在技術上無法確定完整資源的長度。

When EPUB creators compress streams of data before encrypting, they SHOULD provide additional EncryptionProperties metadata to specify the size of the initial resource (i.e., before compression and encryption), as per the Compression XML element defined below. When EPUB creators do not compress streams of data before encrypting, they MAY provide the additional EncryptionProperties metadata to specify the size of the initial resource (i.e., before encryption).
當 EPUB 建立者在加密之前壓縮數據流時,他們應該提供額外的 EncryptionProperties 元數據來指定初始資源的大小(即在壓縮和加密之前),如下面定義的 Compression XML 元素所示。當 EPUB 建立者在加密之前不壓縮數據流時,他們可能會提供額外的 EncryptionProperties 元數據來指定初始資源的大小(即在加密之前)。

Element Name: 元素名稱:


Namespace: 命名空間:


Usage: 用法:

OPTIONAL child of EncryptionProperty.
的OPTIONAL子項 EncryptionProperty

Attributes: 屬性:
Method [required] 方法 [required]

Identifies the compression method used.

Value is either "0" (no compression) or "8" (Deflate algorithm).
值為 “ 0 ”(無壓縮)或 “ 8 ” (Deflate 演算法)。

OriginalLength [required] 原始長度 [required]

Represents the size of the initial resource (number of bytes).

Value is a positive integer.
value 是正整數。

Content Model: 內容模型:

Empty Manifest file (manifest.xml) 清單檔 ( manifest.xml

The OPTIONAL manifest.xml file in the META-INF directory provides a manifest of files in the container.
META-INF 目錄中的 OPTIONAL manifest.xml 檔提供容器中文件的清單。

The OCF specification does not mandate a format for the manifest.
OCF 規範不強制要求清單的格式。

Note that package documents specify the only manifests used for processing EPUB publications. Reading systems do not use this file.
請注意,包文檔指定僅用於處理 EPUB 出版物的清單。讀取系統不使用此檔。

Note 注意
This feature exists only for compatibility with [odf].
此功能僅存在與 [ odf 相容。 Metadata file (metadata.xml) 元數據檔 ( metadata.xml

The OPTIONAL metadata.xml file in the META-INF directory is only for container-level metadata.
META-INF 目錄中的OPTIONAL metadata.xml 檔僅用於容器級元數據。

If EPUB creators include a metadata.xml file, they SHOULD use only namespace-qualified elements [xml-names] in it. The file SHOULD contain the root element [xml] metadata in the namespace http://www.idpf.org/2013/metadata, but this specification allows other root elements for backwards compatibility.
如果 EPUB 建立者包含檔 metadata.xml ,則他們應僅在其中使用限定命名空間的元素 [ xml-names]。該檔應包含命名空間 http://www.idpf.org/2013/metadata 中的根元素 [ xml] metadata ,但此規範允許其他根元素向後相容。

This version of the specification does not define metadata for use in the metadata.xml file. Future versions of this specification MAY define container-level metadata.
此版本的規範未定義在 metadata.xml 檔中使用的元數據。此規範的未來版本可能會定義容器級元數據。 Rights management file (rights.xml) 許可權管理檔 ( rights.xml

This specification reserves the OPTIONAL rights.xml file in the META-INF directory for the trusted exchange of EPUB publications among rights holders, intermediaries, and users.
本規範在 META-INF 目錄中保留了OPTIONAL rights.xml 檔,用於在權利人、中間人和用戶之間可信交換EPUB出版物。

When EPUB creators do not include a rights.xml file, no part of the OCF abstract container is rights governed at the container level. Rights expressions might exist within the EPUB publications.
當 EPUB 建立者不包含 rights.xml 檔時,OCF 抽象容器的任何部分都不會在容器級別進行許可權管理。EPUB 出版物中可能存在權利表達。 Digital signatures file (signatures.xml) 數位簽名檔 ( signatures.xml
Note 注意

Adding a digital signature is not a guarantee that a malicious actor cannot tamper with an EPUB publication as reading systems do not have to check signatures.
添加數字簽名並不能保證惡意行為者不會篡改 EPUB 出版物,因為讀取系統不必檢查簽名。

The OPTIONAL signatures.xml file in the META-INF directory holds digital signatures for the container and its contents.
META-INF 目錄中的 OPTIONAL signatures.xml 檔保存容器及其內容的數位簽名。 The signatures element signatures 元素
Element Name: 元素名稱:


Namespace: 命名空間:


Usage: 用法:

REQUIRED root element [xml] of the signature.xml file.
signature.xml 檔的 REQUIRED 根元素 [ xml]。

Attributes: 屬性:

None 沒有

Content Model: 內容模型:
  • Signature [1 or more]  Signature [1個以上]

The signature element contains child elements of type Signature, as defined by [xmldsig-core1]. EPUB creators can apply signatures to an EPUB publication as a whole or to its parts, and can specify the signing of any kind of data (i.e., not just XML).
signature 元素包含 Signature 類型的子元素,由 [ xmldsig-core1] 定義。EPUB 建立者可以將簽名應用於整個 EPUB 出版物或其部分,並且可以指定任何類型的數據(即,不僅僅是 XML)的簽名。

Note 注意

An XML Schema also informally defines the content of the signatures.xml file.
XML 架構還非正式地定義 signatures.xml 文件的內容。

When an EPUB creator does not include a signatures.xml file, they are not signing any part of the OCF abstract container at the container level. Digital signing might exist within the EPUB publication.
當 EPUB 建立者不包含 signatures.xml 檔時,他們不會在容器級別對 OCF 抽象容器的任何部分進行簽名。數字簽名可能存在於 EPUB 出版物中。

When an EPUB creator creates a data signature for the OCF abstact container, they SHOULD add the signature as the last child Signature element of the signatures element.
當 EPUB 建立者為 OCF abstact 容器創建數據簽名時,他們應將簽名添加為 signatures 元素的最後一個子 Signature 元素。

Note 注意

Each Signature in the signatures.xml file identifies by URL [url] the data to which the signature applies, using the [xmldsig-core1] Manifest element and its Reference sub-elements. EPUB creator may sign individual container files separately or together. Separately signing each file creates a digest value for the resource that reading systems can validate independently. This approach might make a Signature element larger. If EPUB creators sign files together, they can list the set of signed files in a single XML Signature Manifest element and reference them by one or more Signature elements.
檔中的每個 Signature 元素都使用 [ xmldsig-core1] Manifest 元素及其 Reference 子元素通過 URL [ url] 標識應用簽名 signatures.xml 的數據。EPUB 建立者可以單獨或一起對單個容器文件進行簽名。對每個檔單獨簽名會為讀取系統可以獨立驗證的資源創建一個摘要值。此方法可能會使 Signature 元素變大。如果 EPUB 建立者將檔簽名在一起,則他們可以在單個 XML 簽名 Manifest 元素中列出簽名檔集,並通過一個或多個 Signature 元素引用它們。

EPUB creators can sign any or all files in the OCF abstract container in their entirety, except for the signatures.xml file since that file will contain the computed signature information. Whether and how EPUB creators sign the signatures.xml file depends on their objective.
EPUB 建立者可以對 OCF 抽象容器中的任何或所有檔進行完整簽名,但 signatures.xml 檔除外,因為該檔將包含計算出的簽名資訊。EPUB 建立者是否以及如何簽署 signatures.xml 檔取決於他們的目標。

If the EPUB creator wants to allow signatures to be added or removed from the OCF abstract container without invalidating their signature, they SHOULD NOT sign the signatures.xml file.
如果 EPUB 建立者希望允許在 OCF 抽象容器中添加或刪除簽名,而不會使其簽名無效,則他們不應對 signatures.xml 檔進行簽名。

If the EPUB creator wants any addition or removal of a signature to invalidate their signature, they can use the Enveloped Signature transform defined in Section 6.6.4 of [xmldsig-core1] to sign the entire pre-existing signature file excluding the Signature being created. This transform would sign all previous signatures, and it would become invalid if a subsequent signature were added to the package.
如果 EPUB 建立者希望添加或刪除任何簽名以使其簽名無效,則可以使用 [ xmldsig-core1] 的第 6.6.4 節中定義的信封簽名轉換對整個預先存在的簽名檔進行簽名,但不包括正在創建的 Signature 簽名檔。此轉換將對所有以前的簽名進行簽名,如果將後續簽名添加到包中,則該轉換將變為無效。

Note 注意

If the EPUB creator wants the removal of an existing signature to invalidate their signature, but also wants to allow the addition of signatures, they could use an XPath transform to sign just the existing signatures. The details of such a transform are outside the scope of this specification, however.
如果 EPUB 建立者希望刪除現有簽名以使其簽名失效,但又希望允許添加簽名,則可以使用 XPath 轉換僅對現有簽名進行簽名。但是,這種轉換的細節超出了本規範的範圍。

The [xmldsig-core1] specification does not associate any semantics with a signature; an agent might include semantic information, for example, by adding information to the Signature element that describes the signature. The [xmldsig-core1] specification describes how additional information can be added to a signature, such as by use the SignatureProperties element.
[ xmldsig-core1] 規範不會將任何語義與簽名相關聯;代理可以包含語義資訊,例如,通過向描述簽名的 Signature 元素添加資訊。[ xmldsig-core1] 規範描述了如何將其他資訊添加到簽名中,例如通過使用 SignatureProperties 元素。

4.3 OCF ZIP container 4.3 OCF ZIP容器

4.3.1 Introduction 4.3.1 簡介

This section is non-normative.

An OCF ZIP container is a physical single-file manifestation of an OCF abstract container. The container allows:
OCF ZIP 容器是 OCF 抽象容器的物理單文件表現形式。容器允許:

  • the exchange of in-progress EPUB publication between different individuals and/or different organizations;

  • the transfer of EPUB publications from a publisher or conversion house to the distribution or sales channel; and
    將 EPUB 出版物從出版商或轉換公司轉移到分銷或銷售管道;和

  • the delivery of EPUB publications to EPUB reading systems or users.
    將 EPUB 出版物交付給 EPUB 閱讀系統或使用者。

4.3.2 ZIP file requirements
4.3.2 ZIP檔要求

An OCF ZIP container uses the ZIP format as specified by [zip], but with the following constraints and clarifications:
OCF ZIP 容器使用 [ zip] 指定的 ZIP 格式,但具有以下約束和說明:

  • The contents of the OCF ZIP container MUST be a conforming OCF abstract container.
    OCF ZIP容器的內容必須是符合OCF抽象容器的規範。

  • OCF ZIP containers MUST NOT use the features in the ZIP application note [zip] that allow ZIP files to be spanned across multiple storage media or be split into multiple files.
    OCF ZIP容器不得使用ZIP應用說明[zip]中的功能,這些功能允許ZIP檔跨多個存儲介質或拆分為多個檔。

  • OCF ZIP containers MUST include only stored (uncompressed) and Deflate-compressed ZIP entries within the ZIP archive.
    OCF ZIP 容器必須僅包含 ZIP 存檔中存儲的(未壓縮)和 Deflate 壓縮的 ZIP 條目。

  • OCF ZIP containers MAY use the ZIP64 extensions defined as "Version 1" in section V, subsection G of the application note [zip] and SHOULD use only those extensions when the content requires them.
    OCF ZIP容器可以使用應用筆記[zip]第五節G小節中定義為“版本1”的ZIP64擴展,並且應僅在內容需要時使用這些擴展。

  • OCF ZIP containers MUST NOT use the encryption features defined by the ZIP format; instead, encryption MUST be done using the features described in Encryption file (encryption.xml).
    OCF ZIP容器不得使用ZIP格式定義的加密功能;相反,必須使用 加密檔 ( encryption.xml ) 中描述的功能進行加密。

  • OCF ZIP containers MUST encode file system names using UTF-8 [unicode].
    OCF ZIP 容器必須使用UTF-8 [ unicode] 對檔案系統名稱進行編碼。

The following constraints apply to specific fields in the OCF ZIP container archive:
以下約束適用於OCF ZIP容器存檔中的特定欄位:

  • In the local file header table, EPUB creators MUST set the version needed to extract fields to the values 10, 20 or 45 to match the maximum version level needed by the given file (e.g., 20 for Deflate, 45 for ZIP64).
    在本地檔頭表中,EPUB 建立者必須將 version needed to extract 字段設置為值 102045 匹配給定檔所需的最大版本級別(例如, 20 對於Deflate, 45 對於 ZIP64)。

  • In the local file header table, EPUB creators MUST set the compression method field to the values 0 or 8.
    在本地檔案頭表中,EPUB 建立者必須將 compression 方法欄位設定為值 08 .

4.3.3 OCF ZIP container media type identification
4.3.3 OCF ZIP容器介質類型識別

EPUB creators MUST include the mimetype file as the first file in the OCF ZIP container. In addition:
EPUB 建立者必須將該 mimetype 檔作為 OCF ZIP 容器中的第一個檔包含在內。另外:

  • The contents of the mimetype file MUST be the MIME media type [rfc2046] string application/epub+zip encoded in US-ASCII [us-ascii].
    mimetype 文件的內容必須是以 US-ASCII [us-ascii] 編碼的 MIME 媒體類型 [ rfc2046] 字串 application/epub+zip
  • The mimetype file MUST NOT contain any leading or trailing padding or white space.
    mimetype 不得包含任何前導或尾隨填充或空格。
  • The mimetype file MUST NOT begin with the Unicode byte order mark U+FEFF.
    mimetype 檔不得以 Unicode 位元組順序標記 U+FEFF 開頭。
  • EPUB creators MUST NOT compress or encrypt the mimetype file.
    EPUB 建立者不得壓縮或加密 mimetype 檔。
  • EPUB creators MUST NOT include an extra field in its ZIP header.
    EPUB 建立者不得在其 ZIP 標頭中包含額外的欄位。
Note 注意

Refer to I.2 The application/epub+zip media type for further information about the application/epub+zip media type.
有關 application/epub+zip 介質類型的更多資訊,請參閱 I.2 application/epub+zip 介質類型。

4.4 Font obfuscation 4.4 字體混淆

Caution 謹慎

Better methods of protecting fonts exist. Both [woff] and [woff2] fonts, for example, allow the embedding of licensing information and provide some protection through font table compression. The use of remotely hosted fonts also allows for font subsetting. EPUB creators are advised to use font obfuscation as defined in this section only when no other options are available to them. See also the limitations of obfuscation.
存在更好的字體保護方法。例如,[ woff] 和 [ woff2] 字體都允許嵌入許可資訊,並通過字體表壓縮提供一些保護。使用遠端託管字體還允許字體子集。建議 EPUB 建立者僅在沒有其他選項可用時才使用本節中定義的字體混淆。另請參閱混淆的局限性。

4.4.1 Introduction 4.4.1 簡介

This section is non-normative.

Since an OCF ZIP container is fundamentally a ZIP file, commonly available ZIP tools can be used to extract any unencrypted content stream from the package. Moreover, the nature of ZIP files means that their contents might appear like any other native container on some systems (e.g., a folder).
由於OCF ZIP容器基本上是一個ZIP檔,因此可以使用常用的ZIP工具從包中提取任何未加密的內容流。此外,ZIP檔的性質意味著它們的內容可能在某些系統(例如,資料夾)上看起來像任何其他本機容器。

While this simplicity of ZIP files is quite useful, it also poses a problem when ease of extraction of fonts is not a desired side-effect of not encrypting them. An EPUB creator who wishes to include a third-party font, for example, typically does not want that font extracted and re-used by others. More critically, many commercial fonts allow embedding, but embedding a font implies making it an integral part of the EPUB publication, not just providing the original font file along with the content.
雖然ZIP檔的這種簡單性非常有用,但是當字體的易於提取不是不加密字體的理想副作用時,它也會帶來問題。例如,希望包含第三方字體的 EPUB 建立者通常不希望該字體被其他人提取和重複使用。更關鍵的是,許多商業字體允許嵌入,但嵌入字體意味著使其成為 EPUB 出版物的一個組成部分,而不僅僅是提供原始字體檔和內容。

Since integrated ZIP support is so ubiquitous in modern operating systems, simply placing a font in the OCF ZIP container is insufficient to signify that the font cannot be reused in other contexts. This uncertainty can undermine the otherwise useful font embedding capability of EPUB publications.
由於集成的ZIP支援在現代操作系統中無處不在,因此簡單地將字體放在OCF ZIP容器中不足以表示該字體不能在其他上下文中重複使用。這種不確定性可能會破壞 EPUB 出版物原本有用的字體嵌入功能。

To discourage reuse of their fonts, some font vendors might only allow their use in EPUB publications if the fonts are bound in some way to the EPUB publication. That is, if the font file cannot be installed directly for use on an operating system with the built-in tools of that computing device, and it cannot be directly used by other EPUB publications.
為了阻止重複使用其字體,某些字體供應商可能只允許在 EPUB 出版物中使用字體,前提是字體以某種方式綁定到 EPUB 出版物。也就是說,如果字體檔不能直接安裝以在具有該計算設備的內置工具的操作系統上使用,並且它不能直接被其他 EPUB 出版物使用。

It is beyond the scope of this specification to provide a digital rights management or enforcement system for fonts. This section instead defines a method of obfuscation that will require additional work on the part of the final OCF recipient to gain general access to any obfuscated fonts.
為字體提供數位版權管理或執行系統超出了本規範的範圍。本部分定義了一種混淆方法,該方法需要最終 OCF 收件者進行額外的工作才能獲得對任何混淆字體的常規訪問許可權。

4.4.2 Limitations 4.4.2 限制

This section is non-normative.

This specification does not claim that obfuscation constitutes encryption, nor does it guarantee that the resource will be secure from copyright infringement. The hope is only that this algorithm will meet the requirements of vendors who require some assurance that their fonts cannot be extracted simply by unzipping the OCF ZIP container and copying the resource.
本規範並不聲稱混淆構成加密,也不保證資源不會受到版權侵犯。希望這種演算法能夠滿足供應商的要求,他們需要保證他們的字體不能簡單地通過解壓縮OCF ZIP容器並複製資源來提取。

Obfuscation, like any protection scheme, cannot fully protect fonts from being accessed in their deobfuscated state. The mechanism only provides an obstacle for those who are unaware of the license details. It will not prevent a determined user from gaining full access to the font through such alternative means as:

  • applying the deobfuscation algorithm to extract the raw font file;
  • accessing the deobfuscated font through a reading system that must dedobfuscate it to render the content (e.g., by accessing the resources through a browser-based reading system); or
  • accessing the deobfuscated font through authoring tools that provide the visual rendering of the content.

As a result, whether this method of obfuscation satisfies the requirements of individual font licenses remains a question for the licensor and licensee. EPUB creators are responsible for ensuring their use of obfuscation meets font licensing requirements.
因此,這種混淆方法是否滿足單個字體許可證的要求仍然是許可人和被許可人的問題。EPUB 建立者有責任確保其混淆的使用符合字體許可要求。

EPUB creators should also be aware that obfuscation may lead to interoperability issues in reading systems as reading systems are not required to deobfuscate fonts. As a result, the visual presentation of their publications may differ from reading system to reading system.
EPUB 建立者還應該意識到,混淆可能會導致閱讀系統的互操作性問題,因為閱讀系統不需要對字體進行反混淆處理。因此,其出版物的視覺呈現可能因閱讀系統而異。

Also note that the algorithm is restricted to obfuscating fonts. It is not intended as a general-purpose mechanism for obfuscating any resource in the EPUB container.
另請注意,該演算法僅限於混淆字體。它不是用於混淆 EPUB 容器中任何資源的通用機制。

4.4.3 Obfuscation key 4.4.3 混淆鍵

EPUB creators MUST derive the key used in the obfuscation algorithm from the unique identifier.
EPUB 建立者必須從唯一標識符派生混淆演算法中使用的密鑰。

All white space characters, as defined in section 2.3 of the XML 1.0 specification [xml], MUST be removed from this identifier — specifically, the Unicode code points U+0020, U+0009, U+000D and U+000A.
必須從此標識碼中刪除 XML 1.0 規範 [ xml 第 2.3 節中定義的所有空格字元 — 具體而言,是 Unicode 碼位 U+0020U+0009U+000D U+000A

EPUB creators MUST generate a SHA-1 digest of the UTF-8 representation of the resulting string as specified by the Secure Hash Standard [fips-180-4]. They can then use this digest as the key for the algorithm.
EPUB 建立者必須按照安全哈希標準 [fips-180-4] 的規定,生成結果字串的 UTF-8 表示形式的 SHA-1 摘要。然後,他們可以將此摘要用作演算法的金鑰。

4.4.4 Obfuscation algorithm
4.4.4 混淆演算法

The algorithm employed to obfuscate fonts consists of modifying the first 1040 bytes (~1KB) of the font file. (In the unlikely event that the font file is less than 1040 bytes, this process will modify the entire file.)
用於混淆字體的演算法包括修改字體檔的前 1040 位元組 (~1KB)。(萬一字體檔小於1040位元組,此過程將修改整個檔。

To obfuscate the original data, store, as the first byte of the embedded font, the result of performing a logical exclusive or (XOR) on the first byte of the raw font file and the first byte of the obfuscation key.
若要對原始數據進行模糊處理,請將對原始字體檔的第一個字節和混淆密鑰的第一個字節執行邏輯互斥 OR (XOR) 的結果存儲為嵌入字體的第一個字節。

Repeat this process with the next byte of source and key and continue for all bytes in the key. At this point, the process continues starting with the first byte of the key and 21st byte of the source. Once 1040 bytes are encoded in this way (or the end of the source is reached), directly copy any remaining data in the source to the destination.
對源和鍵的下一個字節重複此過程,並對鍵中的所有位元組繼續。此時,該過程從金鑰的第一個字節和源的第 21 個字節開始繼續。以這種方式編碼 1040 位元組后(或到達源的末尾),直接將源中的任何剩餘數據複製到目標。

EPUB creators MUST obfuscate fonts before compressing and adding them to the OCF ZIP container. Note that as obfuscation is not encryption, this requirement is not a violation of the one in Encryption file (encryption.xml) to compress fonts before encrypting them.
EPUB 建立者在壓縮字體並將其添加到 OCF ZIP 容器之前必須對字體進行模糊處理。請注意,由於混淆不是加密,因此此要求不違反 加密檔 ( encryption.xml ) 中在加密字體之前壓縮字體的要求。

The following pseudo-code exemplifies the obfuscation algorithm.

  1. set ocf to OCF ZIP container file
    將 ocf 設置為 OCF ZIP 容器檔
  2. set source to font file
  3. set destination to obfuscated font file
  4. set keyData to key for file
  5. set outer to 0 將 outer 設置為 0
  6. while outer < 52 and not (source at EOF)
    而外< 52 而不是(來源於 EOF)
    1. set inner to 0 將 inner 設置為 0
    2. while inner < 20 and not (source at EOF)
      而內部< 20 而不是(來源於 EOF)
      1. read 1 byte from source (Assumes read advances file position)
        從源讀取 1 個字節(假定讀取推進檔案位置)
      2. set sourceByte to result of read
        將 sourceByte 設定為讀取結果
      3. set keyByte to byte inner of keyData
      4. set obfuscatedByte to (sourceByte XOR keyByte)
        將 obfuscatedByte 設置為 (sourceByte XOR keyByte)
      5. write obfuscatedByte to destination
        將 obfuscatedByte 寫入目標
      6. increment inner 增量內部
      end while 結束而
    3. increment outer 增量外部
    end while 結束而
  7. if not (source at EOF) then
    如果不是(來源於 EOF),那麼
    1. read source to EOF 將原始碼讀取到 EOF
    2. write result of read to destination
    end if 如果結束
  8. Deflate destination 放氣目的地
  9. store destination as source in ocf
    在 OCF 中將目標存儲為源

4.4.5 Specifying obfuscated fonts
4.4.5 指定混淆字體

Although not technically encrypted data, all obfuscated fonts MUST have an entry in the encryption.xml file accompanying the EPUB publication (see Encryption file (encryption.xml)).
儘管不是技術加密數據,但所有混淆字體都必須在 EPUB 出版物隨附 encryption.xml 的檔中有一個條目(請參閱 加密檔 ( encryption.xml ))。

EPUB creators MUST specify an EncryptedData element for each obfuscated font. Each EncryptedData element MUST contain a child EncryptionMethod element whose Algorithm attribute has the value http://www.idpf.org/2008/embedding. The presence of this attribute signals the use of the algorithm described in this specification.
EPUB 建立者必須為每種混淆字體指定一個 EncryptedData 元素。每個 EncryptedData 元素必須包含一個子 EncryptionMethod 元素,其 Algorithm 屬性的值 http://www.idpf.org/2008/embedding 為 。此屬性的存在表示使用本規範中描述的演算法。

EPUB creators MUST list the path to the obfuscated font in the CipherReference child of the CipherData element. As the obfuscation algorithm is restricted to fonts, the URI attribute of the CipherReference element MUST reference a Font core media type resource.
EPUB 建立者必須在 CipherData 元素的 CipherReference 子元素中列出混淆字體的路徑。由於混淆演算法僅限於字體,因此 CipherReference 元素的 URI 屬性必須引用字體核心媒體類型資源。

To prevent trivial copying of the embedded font to other EPUB publications, EPUB creators MUST NOT provide the obfuscation key in the encryption.xml file.
為防止將嵌入字體複製到其他 EPUB 出版物,EPUB 建立者不得在 encryption.xml 檔中提供混淆密鑰。

5. Package document 5. 包裝檔

All [xml] elements defined in this section are in the http://www.idpf.org/2007/opf namespace [xml-names] unless otherwise specified.
除非另有說明,否則本節中定義的所有 [ xml] 元素都位於 http://www.idpf.org/2007/opf 命名空間 [ xml-names] 中。

5.1 Introduction 5.1 引言

This section is non-normative.

The package document is an XML document that consists of a set of elements that each encapsulate information about a particular aspect of an EPUB publication. These elements serve to centralize metadata, detail the individual resources, and provide the reading order and other information necessary for its rendering.
包文檔是一個 XML 文件,它由一組元素組成,每個元素都封裝有關 EPUB 出版物特定方面的資訊。這些元素用於集中元數據,詳細說明各個資源,並提供其呈現所需的讀取順序和其他資訊。

The following list summarizes the information found in the package document:

Note 注意

An EPUB publication can reference more than one package document, allowing for alternative representations of the content. For more information, refer to Container file (container.xml)
一個 EPUB 出版物可以引用多個包文檔,從而允許對內容進行替代表示。有關詳細資訊,請參閱 容器檔 ( container.xml

Note 注意

Refer to I.1 The application/oebps-package+xml media type for information about the file properties of package documents.
有關包文檔的文件屬性的資訊,請參閱 I.1 介質 application/oebps-package+xml 類型。

5.2 Parsing URLs in the package document
5.2 解析包文檔中的URL

To parse a URL string url used in the package document, the URL parser [url] MUST be applied to url, with the content URL of the package document as base.
若要分析包文檔中使用的 URL 字串 URL,必須將 URL 解析器 [ url] 應用於 url,並將包文檔的內容 URL 作為基礎。

5.3 Shared attributes 5.3 共用屬性

This section provides definitions for shared attributes (i.e., attributes allowed on two or more elements).

5.3.1 The dir attribute (under-implemented)
5.3.1 dir 屬性(未實現)

Note 注意

The dir attribute is marked under-implemented as reading systems often only support a single default directionality for text display. EPUB creators are still strongly encouraged to set the proper directionality of text values in the package document to ensure proper rendering once this situation improves.
dir 屬性被標記為未實現,因為閱讀系統通常只支援文本顯示的單個預設方向性。我們仍然強烈建議 EPUB 建立者在包文檔中設置文本值的正確方向性,以確保在這種情況改善後正確呈現。

Specifies the base direction [bidi] of the textual content and attribute values of the carrying element and its descendants.
指定承載元素及其後代的文本內容和屬性值的基本方向 [ bidi]。

Allowed values are: 允許的值為:

  • ltr — left-to-right base direction;
    ltr — 從左到右的基本方向;
  • rtl — right-to-left base direction; and
    rtl — 從右到左的基本方向;和
  • auto — base direction is determined using the Unicode Bidi Algorithm [bidi].
    auto — 基方向使用 Unicode 雙向演算法 [ bidi] 確定。

Reading systems will assume the value auto when EPUB creators omit the attribute or use an invalid value.
當 EPUB 建立者省略屬性或使用無效值時,讀取系統將假定該值 auto

Note 注意

The base direction specified in the dir attribute does not affect the ordering of characters within directional runs, only the relative ordering of those runs and the placement of weak directional characters such as punctuation.
dir 屬性中指定的基本方向不會影響定向行中字元的順序,只會影響這些行程的相對順序和弱定向字元(如標點符號)的位置。

Allowed on: collection, dc:contributor, dc:coverage, dc:creator, dc:description, dc:publisher, dc:relation, dc:rights, dc:subject, dc:title, meta and package.
允許在: collection 、 、 、 dc:contributor dc:coverage dc:creator dc:description dc:publisher dc:relation dc:rights dc:subject dc:title metapackage

5.3.2 The href attribute
5.3.2 href 屬性

A valid URL string [url] that references a resource.
引用資源的有效 URL 字串 [ url]。

The URL string MUST NOT reference resources via elements in the package document (e.g., via a manifest item or spine itemref declaration).
URL 字串不得通過包文檔中的元素(例如,通過清單 item 或主 itemref 幹聲明)引用資源。

Allowed on: item and link.
允許在: itemlink

5.3.3 The id attribute
5.3.3 id 屬性

The ID [xml] of the element, which MUST be unique within the document scope.

Allowed on: collection, dc:contributor, dc:coverage, dc:creator, dc:date, dc:description, dc:format, dc:identifier, dc:language, dc:publisher, dc:relation, dc:rights, dc:source, dc:subject, dc:title, dc:type, item, itemref, link, manifest, meta, package and spine.
允許在: collection , , dc:contributor , , dc:coverage dc:creatordc:date dc:description dc:format dc:identifier dc:language dc:publisher dc:relation dc:rights dc:source dc:subject dc:title dc:type item itemref link manifest meta package spine .

5.3.4 The media-type attribute
5.3.4 media-type 屬性

A media type [rfc2046] that specifies the type and format of the referenced resource.
指定引用資源的類型和格式的媒體類型 [ rfc2046]。

Allowed on: item and link.
允許在: itemlink

5.3.5 The properties attribute
5.3.5 properties 屬性

A space-separated list of property values.

Refer to each element's definition for the reserved vocabulary for the attribute.

Allowed on: item, itemref and link.
允許在: itemitemref link .

5.3.6 The refines attribute
5.3.6 refines 屬性

Establishes an association between the current expression and the element or resource identified by its value. EPUB creators MUST use as the value a path-relative-scheme-less-URL string, optionally followed by U+0023 (#) and a URL-fragment string that references the resource or element they are describing.
在當前表達式與其值標識的元素或資源之間建立關聯。EPUB 建立者必須使用 path-relative-scheme-less-URL 字串作為值,(可選)後跟 U+0023 (#) 引用他們所描述的資源或元素的 URL-fragment 字符串。

The refines attribute is OPTIONAL depending on the type of metadata expressed. When omitted, the element defines a primary expression.
refines 屬性是OPTIONAL,具體取決於所表達的元數據類型。省略時,該元素定義主表達式。

When creating expressions about a publication resource, the refines attribute SHOULD specify a fragment identifier that references the ID [xml] of the resource's manifest entry.
創建有關發佈資源的表示式時, refines 該屬性應指定引用資源清單條目的ID[xml]的片段識別碼。

Refinement chains MUST NOT contain circular references or self-references.

Allowed on: link and meta.
允許在: linkmeta

5.3.7 The xml:lang attribute
5.3.7 xml:lang 屬性

Specifies the language of the textual content and attribute values of the carrying element and its descendants, as defined in section 2.12 Language Identification of [xml]. The value of each xml:lang attribute MUST be a well-formed language tag [bcp47].
指定承載元素及其後代的文本內容和屬性值的語言,如第 2.12 節 [ xml 的語言標識中所定義。每個 xml:lang 屬性的值必須是格式正確的語言標記 [bcp47]。

Allowed on: collection, dc:contributor, dc:coverage, dc:creator, dc:description, dc:publisher, dc:relation, dc:rights, dc:subject, dc:title, meta and package.
允許在: collection 、 、 、 dc:contributor dc:coverage dc:creator dc:description dc:publisher dc:relation dc:rights dc:subject dc:title metapackage

5.4 The package element
5.4 package 元素

The package element encapsulates all the information expressed in the package document.
package 元素封裝了包文檔中表示的所有資訊。

Element Name: 元素名稱:


Usage: 用法:

REQUIRED root element [xml] of the package document.
包文件的 REQUIRED 根元素 [ xml]。

Attributes: 屬性:
Content Model: 內容模型:

In this order: 依此順序:

The version attribute specifies the EPUB specification version to which the given EPUB publication conforms. The attribute MUST have the value "3.0" to indicate conformance with EPUB 3.
version 屬性指定給定 EPUB 出版物符合的 EPUB 規範版本。屬性必須具有值 「 3.0 以指示符合 EPUB 3。

Note 注意

Updates to this specification do not represent new versions of EPUB 3 (i.e., each new 3.X specification is a continuation of the EPUB 3 format). The Working Group is committed to minimizing any changes that would invalidate existing content, allowing the version attribute value to remain unchanged.
此規範的更新不代表 EPUB 3 的新版本(即,每個新的 3.X 規範都是 EPUB 3 格式的延續)。工作組致力於盡量減少任何會使現有內容失效的更改,使 version 屬性值保持不變。

The unique-identifier attribute takes an IDREF [xml] that identifies the dc:identifier element that provides the preferred, or primary, identifier.
unique-identifier 屬性採用IDREF[xml],用於標識提供首選或主要標識碼的 dc:identifier 元素。

The prefix attribute provides a declaration mechanism for prefixes not reserved by this specification. Refer to D.1.4 The prefix attribute for more information.
prefix 屬性為未由此規範保留的前綴提供聲明機制。有關詳細資訊,請參閱 D.1.4 屬性 prefix

5.5 Metadata section 5.5 元數據部分

5.5.1 The metadata element
5.5.1 metadata 元素

The metadata element encapsulates meta information.
metadata 元素封裝元資訊。

Element Name: 元素名稱:


Usage: 用法:

REQUIRED first child of package.
必需的第一個子項 package

Attributes: 屬性:

None 沒有

Content Model: 內容模型:

In any order: 按任意順序:

The package document metadata element has two primary functions:
包文件 metadata 元素有兩個主要功能:

  1. to provide a minimal set of meta information for reading systems to use to internally catalogue an EPUB publication and make it available to a user (e.g., to present in a bookshelf).
    為閱讀系統提供一組最小的元資訊,用於對 EPUB 出版物進行內部編目並提供給使用者(例如,在書架上展示)。

  2. to provide access to all rendering metadata needed to control the layout and display of the content (e.g., fixed-layout properties).

The package document does not provide complex metadata encoding capabilities. If EPUB creators need to provide more detailed information, they can associate metadata records (e.g., that conform to an international standard such as [onix] or are created for custom purposes) using the link element. This approach allows reading systems to process the metadata in its native form, avoiding the potential problems and information loss caused by translating to use the minimal package document structure.
包文檔不提供複雜的元數據編碼功能。如果 EPUB 建立者需要提供更詳細的資訊,他們可以使用該 link 元素關聯元數據記錄(例如,符合 [ onix] 等國際標準或為自定義目的創建的元數據記錄)。這種方法允許讀取系統以本機形式處理元數據,從而避免了因使用最小包文檔結構進行翻譯而導致的潛在問題和信息丟失。

In keeping with this philosophy, the package document only has the following minimal metadata requirements: it MUST contain the [dcterms] dc:title, dc:identifier, and dc:language elements together with the [dcterms] dcterms:modified property. All other metadata is OPTIONAL.
為了與這一理念保持一致,包文檔僅具有以下最低元數據要求:它必須包含 [ dcterms] dc:titledc:identifierdc:language 元素以及 [ dcterms] dcterms:modified 屬性。所有其他元數據都是可選的。

The meta element provides a generic mechanism for including metadata properties from any vocabulary. Although EPUB creators MAY use this mechanism for any metadata purposes, they will typically use it to include rendering metadata defined in EPUB specifications.
meta 元素提供了一種通用機制,用於包含來自任何詞彙表的元數據屬性。儘管 EPUB 建立者可以將此機制用於任何元數據目的,但他們通常會使用它來包含 EPUB 規範中定義的呈現元數據。

Note 注意

See [epub-a11y-11] for accessibility metadata recommendations.
請參閱 [ epub-a11y-11] 瞭解輔助功能元數據建議。

5.5.2 Metadata values 5.5.2 元數據值

The Dublin Core elements [dcterms] and meta element have mandatory child text content [dom]. In the descriptions for these elements, this specification refers to this content as the element's value.
Dublin Core 元素 [ dcterms] 和 meta 元素具有必需的子文本內容 [ dom]。在這些元素的描述中,此規範將此內容稱為元素的值。

These elements MUST have non-empty values after leading and trailing ASCII whitespace [infra] is stripped (i.e., they must consist of at least one non-whitespace character).
在前導和尾隨 ASCII 空格 [ infra] 被剝離后,這些元素必須具有非空值(即,它們必須包含至少一個非空格字元)。

Whitespace within these element values is not significant. Sequences of one or more whitespace characters are collapsed to a single space [infra] during processing .
這些元素值中的空格並不重要。在處理過程中,一個或多個空格字元的序列被摺疊到單個空格 [ infra] 。

5.5.3 Dublin Core required elements
5.5.3 都柏林核心必需元素 The dc:identifier element dc:identifier 元素

The dc:identifier element [dcterms] contains an identifier such as a UUID, DOI or ISBN.
dc:identifier 元素 [ dcterms] 包含一個識別碼,例如 UUID、DOI 或 ISBN。

Element Name: 元素名稱:


Namespace: 命名空間:


Usage: 用法:

REQUIRED child of metadata. Repeatable.
的必需子項 metadata 。重複。

Attributes: 屬性:
  • id [conditionally required]

Content Model: 內容模型:

Text 發簡訊

The EPUB creator MUST provide an identifier that is unique to one and only one EPUB publication — its unique identifier — in an dc:identifier element. This dc:identifier element MUST specify an id attribute whose value is referenced from the package element's unique-identifier attribute.
EPUB 建立者必須提供元素中 dc:identifier 一個且只有一個 EPUB 出版物唯一的標識碼(其唯一標識符)。此 dc:identifier 元素必須指定一個 id 屬性,其值是從 package 元素 unique-identifier 的屬性引用的。

Although not static, EPUB creators should make changes to the unique identifier for an EPUB publication as infrequently as possible. Unique Identifiers should have maximal persistence both for referencing and distribution purposes. EPUB creators should not issue new identifiers when making minor revisions such as updating metadata, fixing errata, or making similar minor changes.
雖然不是一成不變的,但 EPUB 建立者應盡可能少地更改 EPUB 出版物的唯一標識符。唯一標識碼應具有最大的持久性,用於引用和分發目的。EPUB 建立者在進行小修訂(例如更新元數據、修正勘誤表或進行類似的小改動)時不應發佈新標識符。

EPUB creators MAY specify additional identifiers. The identifiers should be fully qualified URIs.
EPUB 建立者可以指定其他識別碼。標識碼應是完全限定的 URI。

EPUB creators MAY use the identifier-type property to indicate that the value of a dc:identifier element conforms to an established system or an issuing authority granted it.
EPUB 建立者可以使用該 identifier-type 屬性來指示 dc:identifier 元素的價值符合既定系統或授予它的頒發機構。 The dc:title element dc:title 元素

The dc:title element [dcterms] represents an instance of a name for the EPUB publication.
dc:title 元素 [ dcterms] 表示 EPUB 出版物的名稱實例。

Element Name: 元素名稱:


Namespace: 命名空間:


Usage: 用法:

REQUIRED child of metadata. Repeatable.
的必需子項 metadata 。重複。

Attributes: 屬性:
Content Model: 內容模型:

Text 發簡訊

The first dc:title element in document order is the main title of the EPUB publication (i.e., the primary one reading systems present to users).
文檔順序中的第一個 dc:title 元素是 EPUB 出版物的主標題(即向使用者展示的主要閱讀系統)。

EPUB creators should use only a single dc:title element to ensure consistent rendering of the title in reading systems.
EPUB 建立者應僅使用單個 dc:title 元素,以確保標題在閱讀系統中的呈現一致。

Note 注意

Although it is possible to include more than one dc:title element for multipart titles, reading system support for additional dc:title elements is inconsistent. Reading systems may ignore the additional segments or combine them in unexpected ways.
儘管可以為多部分標題包含多個 dc:title 元素,但閱讀系統對其他 dc:title 元素的支援並不一致。閱讀系統可能會忽略其他片段或以意想不到的方式組合它們。

For example, the following example shows a basic multipart title:

<metadata …>
      Part One: The Fellowship of the Ring

The same title could instead be expressed using a single dc:title element as follows:
可以使用單個 dc:title 元素來表示相同的標題,如下所示:

<metadata …>
       THE LORD OF THE RINGS, Part One:
       The Fellowship of the Ring

Previous versions of this specification recommended using the title-type and display-seq properties to identify and format the segments of multipart titles (see the Great Cookbooks example). It is still possible to add these semantics, but they are also not well supported.
此規範的早期版本建議使用 title-type and display-seq 屬性來標識多部分標題的段並設置其格式(請參閱 Great Cookbooks 示例)。仍然可以添加這些語義,但它們也沒有得到很好的支援。 The dc:language element dc:language 元素

The dc:language element [dcterms] specifies the language of the content of the EPUB publication.
dc:language 元素 [ dcterms] 指定 EPUB 出版物內容的語言。

Element Name: 元素名稱:


Namespace: 命名空間:


Usage: 用法:

REQUIRED child of metadata. Repeatable.
的必需子項 metadata 。重複。

Attributes: 屬性:

id [optional]

Content Model: 內容模型:

Text 發簡訊

The value of each dc:language element MUST be a well-formed language tag [bcp47].
每個 dc:language 元素的值必須是格式正確的語言標記 [ bcp47]。

Although EPUB creators MAY specify additional dc:language elements for multilingual Publications, reading systems will treat the first dc:language element in document order as the primary language of the EPUB publication.
儘管 EPUB 建立者可以為多語言出版物指定其他 dc:language 元素,但閱讀系統會將文檔順序中的第一個 dc:language 元素視為 EPUB 出版物的主要語言。

Note 注意

Publication resources do not inherit their language from the dc:language element(s). EPUB creators must set the language of a resource using the intrinsic methods of the format.
發佈資源不會從 dc:language 元素繼承其語言。EPUB 建立者必須使用格式的固有方法設置資源的語言。

5.5.4 Dublin Core optional elements
5.5.4 都柏林核心可選元素 General definition 一般定義

All [dcterms] elements except for dc:identifier, dc:language, and dc:title are designated as OPTIONAL. These elements conform to the following generalized definition:
除 、 dc:languagedc:title 之外 dc:identifier 的所有 [ dcterms] 元素都指定為 OPTIONAL。這些元素符合以下廣義定義:

Element Name: 元素名稱:

dc:contributor | dc:coverage | dc:creator | dc:date | dc:description | dc:format | dc:publisher | dc:relation | dc:rights | dc:source | dc:subject | dc:type
dc:contributor | dc:coverage | dc:creator | dc:date | dc:description | dc:format | dc:publisher | dc:relation | dc:rights | dc:source | dc:subject | dc:type

Namespace: 命名空間:


Usage: 用法:

OPTIONAL child of metadata. Repeatable.
的OPTIONAL子項 metadata 。重複。

Attributes: 屬性:
  • dir [optional] – only allowed on dc:contributor, dc:coverage, dc:creator, dc:description, dc:publisher, dc:relation, dc:rights, and dc:subject.
    dir [optional] – 只允許在 dc:contributordc:coverage 、 、 dc:creatordc:description dc:publisherdc:relation dc:rights dc:subject 上 。

  • id [optional] – allowed on any element.
    id [optional] – 允許在任何元素上。

  • xml:lang [optional] – only allowed on dc:contributor, dc:coverage, dc:creator, dc:description, dc:publisher, dc:relation, dc:rights, and dc:subject.
    xml:lang [optional] – 只允許在 dc:contributordc:coverage 、 、 dc:creatordc:description dc:publisherdc:relation dc:rights dc:subject 上 。

Content Model: 內容模型:

Text 發簡訊

This specification does not modify the [dcterms] element definitions except as noted in the following sections.
本規範不修改 [ dcterms] 元素定義,除非以下各節中另有說明。 The dc:contributor element dc:contributor 元素

The dc:contributor element [dcterms] is used to represent the name of a person, organization, etc. that played a secondary role in the creation of the content.
dc:contributor 元素 [ dcterms] 用於表示在內容建立中起次要作用的個人、組織等的名稱。

The requirements for the dc:contributor element are identical to those for the dc:creator element in all other respects.
在所有其他方面,對 dc:contributor 元素的要求與 dc:creator 對元素的要求相同。 The dc:creator element dc:creator 元素

The dc:creator element [dcterms] represents the name of a person, organization, etc. responsible for the creation of the content. EPUB creators MAY associate a role property with the element to indicate the function the creator played.
dc:creator 元素 [ dcterms] 表示負責建立內容的個人、組織等的名稱。EPUB 建立者可以將 role 屬性與元素相關聯,以指示建立者所扮演的功能。

The dc:creator element should contain the name of the creator as EPUB creators intend reading systems to display it to users.
dc:creator 元素應包含創建者的姓名,因為 EPUB 建立者打算閱讀系統將其顯示給使用者。

EPUB creators MAY use the file-as property to associate a normalized form of the creator's name, and the alternate-script property to represent the creator's name in another language or script.
EPUB 建立者可以使用該 file-as 屬性來關聯建立者姓名的規範化形式,並使用該 alternate-script 屬性以另一種語言或腳本表示創建者的名稱。

If an EPUB publication has more than one creator, EPUB creators should specify each in a separate dc:creator element.
如果 EPUB 出版物有多個建立者,則 EPUB 建立者應在單獨的 dc:creator 元素中指定每個建立者。

The document order of dc:creator elements in the metadata section determines the display priority, where the first dc:creator element encountered is the primary creator.
metadata 該部分中元素的 dc:creator 文檔順序決定了顯示優先順序,其中遇到的第一個 dc:creator 元素是主要建立者。

EPUB creators should represent secondary contributors using the dc:contributor element.
EPUB 建立者應代表使用該 dc:contributor 元素的次要貢獻者。 The dc:date element dc:date 元素

The dc:date element [dcterms] defines the publication date of the EPUB publication. The publication date is not the same as the last modified date (the last time the EPUB creator changed the EPUB publication).
dc:date 元素 [ dcterms] 定義 EPUB 出版物的發佈日期。發佈日期與上次修改日期(EPUB 建立者上次更改 EPUB 發佈時間)不同。

It is RECOMMENDED that the date string conform to [iso8601], particularly the subset expressed in W3C Date and Time Formats [datetime], as such strings are both human and machine readable.
建議日期字串符合 [ iso8601],尤其是以 W3C 日期和時間格式 [ datetime 表示的子集,因為此類字串是人類和機器可讀的。

EPUB creators should express additional dates using the specialized date properties available in the [dcterms] vocabulary, or similar.
EPUB 建立者應使用 [ dcterms] 詞彙表或類似詞彙表中提供的專用日期屬性來表示其他日期。

EPUB publications MUST NOT contain more than one dc:date element.
EPUB 出版物不得包含多個 dc:date 元素。 The dc:subject element dc:subject 元素

The dc:subject element [dcterms] identifies the subject of the EPUB publication. EPUB creators should set the value of the element to the human-readable heading or label, but may use a code value if the subject taxonomy does not provide a separate descriptive label.
dc:subject 元素 [ dcterms] 標識 EPUB 出版物的主題。EPUB 建立者應將元素的值設置為人類可讀的標題或標籤,但如果主題分類未提供單獨的描述性標籤,則可以使用代碼值。

EPUB creators MAY identify the system or scheme they drew the element's value from using the authority property.
EPUB 建立者可以識別他們從使用該 authority 屬性中提取元素值的系統或方案。

When a scheme is identified, EPUB creators MUST associate a subject code using the term property.
確定方案后,EPUB 建立者必須使用該 term 屬性關聯主題代碼。

The term property MUST NOT be associated with a dc:subject element that does not specify a scheme.
term 屬性不得與未指定方案的 dc:subject 元素相關聯。

The values of the dc:subject element and term property are case sensitive only when the designated scheme requires.
僅當指定方案需要時, dc:subject 元素和 term 屬性的值才區分大小寫。 The dc:type element dc:type 元素

The dc:type element [dcterms] is used to indicate that the EPUB publication is of a specialized type (e.g., annotations or a dictionary packaged in EPUB format).
dc:type 元素 [ dcterms] 用於指示 EPUB 出版物屬於特殊類型(例如,以 EPUB 格式打包的註釋或字典)。

EPUB creators MAY use any text string as a value.
EPUB 建立者可以使用任何文字字串作為值。

Note 注意

The former IDPF EPUB 3 Working Group maintained a non-normative registry of specialized EPUB publication types for use with this element. This Working Group no longer maintains the registry and does not anticipate developing new specialized publication types.
前IDPF EPUB 3工作組維護了一個非規範性登記冊,用於該要素的專門EPUB出版物類型。該工作組不再維護登記冊,也不期望開發新的專門出版物類型。

5.5.5 The meta element
5.5.5 meta 元素

The meta element provides a generic means of including package metadata.
meta 元素提供了包含包元數據的通用方法。

Element Name: 元素名稱:


Usage: 用法:

As child of the metadata element. Repeatable.
作為 metadata 元素的子元素。重複。

Attributes: 屬性:
Content Model: 內容模型:

Text 發簡訊

Each meta element defines a metadata expression. The property attribute takes a property data type value that defines the statement made in the expression, and the text content of the element represents the assertion. (Refer to D.1 Vocabulary association mechanisms for more information.)
每個 meta 元素都定義一個元數據表達式。該 property 屬性採用屬性數據類型值,該值定義在表達式中創建的語句,元素的文本內容表示斷言。(有關詳細資訊,請參閱 D.1 詞彙關聯機制。

This specification defines two types of metadata expressions that EPUB creators can define using the meta element:
此規範定義了兩種類型的元數據表示式,EPUB 建立者可以使用該 meta 元素定義這些表示式:

  • A primary expression is one in which the expression defined in the meta element establishes some aspect of the EPUB publication. A meta element that omits a refines attribute defines a primary expression.
    主表達式是指 meta 元素中定義的表達式建立 EPUB 發佈的某些方面的表達式。省略 refines 屬性的 meta 元素定義主運算式。
  • A subexpression is one in which the expression defined in the meta element is associated with another expression or resource using the refines attribute to enhance its meaning. A subexpression might refine a media clip, for example, by expressing its duration, or refine a creator or contributor expression by defining the role of the person.
    子運算式是指 meta 元素中定義的表達式與另一個運算式或資源相關聯,使用該 refines 屬性來增強其含義。子表達式可以優化媒體剪輯,例如,通過表示其持續時間,或者通過定義人員的角色來優化建立者或參與者表達式。

EPUB creators MAY use subexpressions to refine the meaning of other subexpressions, thereby creating chains of information.
EPUB 建立者可以使用子表達式來細化其他子表達式的含義,從而創建資訊鏈。

Note 注意

All the [dcterms] elements represent primary expressions, and permit refinement by meta element subexpressions.
所有 [ dcterms] 元素都表示主運算式,並允許通過元元素子表達式進行細化。

The Meta Properties Vocabulary is the default vocabulary for use with the property attribute.
元屬性詞彙表是用於該屬性的 property 默認詞彙表。

EPUB creators MAY add terms from other vocabularies as defined in D.1 Vocabulary association mechanisms.
EPUB 建立者可以從 D.1 詞彙關聯機制中定義的其他詞彙中添加術語。

The scheme attribute identifies the system or scheme the EPUB creator obtained the element's value from. The value of the attribute MUST be a property data type value that resolves to the resource that defines the scheme. The scheme attribute does not have a default vocabulary (i.e., all values require a prefix).
scheme 屬性標識 EPUB 建立者從中獲取元素值的系統或方案。屬性的值必須是解析為定義方案的資源的屬性數據類型值。該 scheme 屬性沒有預設詞彙表(即,所有值都需要前綴)。

5.5.6 Last modified date 5.5.6 上次修改日期

The metadata section MUST contain exactly one dcterms:modified property [dcterms] containing the last modification date. The value of this property MUST be an [xmlschema-2] dateTime conformant date of the form: CCYY-MM-DDThh:mm:ssZ
metadata 部分必須只包含一個 dcterms:modified 包含上次修改日期的屬性 [ dcterms]。這個屬性的值必須是以下形式的 [ xmlschema-2] dateTime 符合日期: CCYY-MM-DDThh:mm:ssZ

EPUB creators MUST express the last modification date in Coordinated Universal Time (UTC) and MUST terminate it with the "Z" (Zulu) time zone indicator.
EPUB 建立者必須以協調世界時 (UTC) 表示上次修改日期,並且必須以“ Z ”(Zulu) 時區指示符結束該日期。

EPUB creators should update the last modified date whenever they make changes to the EPUB publication.
EPUB 建立者在對 EPUB 出版物進行更改時,應更新上次修改日期。

EPUB creators MAY specify additional modified properties in the package document metadata, but they MUST have a different subject (i.e., they require a refines attribute that references an element or resource).
EPUB 建立者可以在包文檔元數據中指定其他修改屬性,但他們必須具有不同的主題(即,它們需要引用元素或資源的 refines 屬性)。

Note 注意

The requirements for the last modification date are to ensure compatibility with earlier versions of EPUB 3 that defined a release identifier [epubpackages-32] for EPUB publications.
對上次修改日期的要求是確保與 EPUB 3 的早期版本相容,該版本為 EPUB 出版物定義了版本標識碼 [epubpackages-32]。