The OPF document is the core file of Epub ebook and is a standard XML file. According to the OPF specification, it consists of five parts:
1. <metadata>, metadata information, composed of two child elements:
- <DC-Metadata> consists of 15 Core Elements Using dubline core (DC), including:
-
- <Title>: Title
- <Creator>: Responsible Person
- <Subject>: Key words or keywords
- <Description>: Content Description
- <Contributor>: contributor or other secondary owner
- <Date>: Date
- <Type>: Type
- <Format>: Format
- <Identifier>: identifier
- <Source>: Source
- <Language>: Language
- <Relation>: related information
- <Coverage>: covered range
- <Rights>: Permission description
- <X-Metadata> is an extension element. If some information cannot be described in the preceding element, it is extended in this element.
2. <menifest>, a file list, which is composed of sub-elements because oebps documents and related documents are listed,
- <Item id = "" href = "" media-type = "> the element consists of three attributes:
- ID: ID of the file
- Href: file relative path
- Media-type: media type of the file
- For example, <item id = "page01" href = "page01.xhtml" media-type = "application/XHTML + XML"/>
- <Item id = "img000" href = "001.png" media-type =" image/PNG "/>
- <Item id = "img001" href = "002.jpg" media-type =" image/JPEG "/>
3. <spine TOC = "NCX">, spine. Its main function is to provide linear reading order of books. Composed of a child element:
- <Itemref idref = ""> consists of one attribute:
-
- Idref: ID listed by menifest
- Example: <itemref idref = "page01"/>
4. <guide>. The Guide lists the specific pages of an e-book, such as the cover, directory, and preface. The attribute value points to the file storage address. Generally, Epub ebook does not need this element.
5. <tour>. You can select some pages in the ebook in order of different reader levels or reading purposes. Generally, Epub ebook does not need this element.
Content. OPF instance
<? XML version = "1.0" encoding = "UTF-8"?> <! Doctype package public "+ // ISBN 978-7-308-05831-5 // DTD oeb 1.2 package // en" "http://openebook.org/dtds/oeb-1.2/oebpkg12.dtd"> <package unique-identifier = "bookid" xmlns: OPF = "http://www.idpf.org/2007/opf" xmlns = "http://www.idpf.org/2007/opf" version = "2.0"> <metadata> <DC-Metadata xmlns: DC = "http://purl.org/dc/elements/1.1/" xmlns: dcterms = "http://purl.org/dc/terms/" xmlns: xsi = "http://www.w3.org/2001/XML Schema-instance "> <DC: title> digital archives theoretical and technical research </DC: title> <DC: Creator> gold upgrade </DC: Creator> <DC: subject> digital archive </DC: Subject> <DC: Subject> electronic file management </DC: Subject> <DC: Subject> metadata </DC: Subject> <DC: subject> digitalization </DC: Subject> <DC: Subject> archive </DC: Subject> <DC: Description> when ...... <DC: Description> <DC: publisher> mechanical industry press </DC: publisher> <DC: contributor/> <DC: Date> 2007-09 </DC: date> <DC: type> normal books </DC: type> <DC: Format> text/html(.html,.htm) </DC: Format> <DC: identifier id = "bookid" OPF: Scheme = "ISBN"> ISBN: 978-7-111-04961-6 </DC: identifier> <DC: Source/> <DC: language> Chi </DC: Language> <DC: relation/> <DC: coverage/> <DC: rights> All rights reserved by Machinery Industry Press </DC: rights> </DC-Metadata> <X-metadata/> </metadata> <manifest> <item id = "NCX" href = "TOC. NCX "media-type =" application/X-dtbncx + XML "/> <item id =" style "href =" style.css "media-type =" text/CSS "/> <item id = "cover" href = "cover.htm" media-type = "text/html"/> <item id = "tableofc" href = "toc.xhtml" media-type =" application/XHTML + XML "/> <item id =" forword "href =" forword.xhtml "media-type =" application/XHTML + XML "/> <item id =" chap01" href = "chap01.xhtml" media-type = "application/XHTML + XML"/> <item id = "chap02" href = "chap02.xhtml" media-type = "application/XHTML + XML "/> <item id =" chap03 "href =" chap03.xhtml "media-type =" application/XHTML + XML "/> <item id =" chap04 "href =" chap04.xhtml" media-type = "application/XHTML + XML"/> <item id = "chap05" href = "chap05.xhtml" media-type = "application/XHTML + XML"/> <item id = "chap06" href = "chap06.xhtml" media-type = "application/XHTML + XML"/> <item id = "chap07" href = "chap07.xhtml" media-type =" application/XHTML + XML "/> <item id =" chap08 "href =" chap08.xhtml "media-type =" application/XHTML + XML "/> <item id =" chap09" href = "chap09.xhtml" media-type = "application/XHTML + XML"/> <item id = "chap10" href = "chap10.xhtml" media-type = "application/XHTML + XML "/> <item id =" Reference "href =" reference.xhtml "media-type =" application/XHTML + XML "/> </manifest> <spine TOC =" NCX "> <itemref idref = "cover"/> <itemref idref = "tableofc"/> <itemref idref = "forword"/> <itemref idref = "chap01"/> <itemref idref = "chap02"/> <itemref idref = "chap03"/> <itemref idref = "chap04"/> <itemref idref = "chap05"/> <itemref idref = "chap06 "/> <itemref idref = "chap07"/> <itemref idref = "chap08"/> <itemref idref = "chap09"/> <itemref idref = "chap10"/> <itemref idref = "Reference"/> </spine> <Guide/> </package>
Original article address