.OPF文件剖析
2012-07-18 10:49
302 查看
OPF文档是epub电子书的核心文件,且是一个标准的XML文件,依据OPF规范,主要由五个部分组成:
1、<metadata>,元数据信息,由两个子元素组成:
<dc-metadata>,其元素构成采用dubline core(DC)的15项核心元素,包括:
<title>:题名
<creator>:责任者
<subject>:主题词或关键词
<description>:内容描述
<contributor>:贡献者或其它次要责任者
<date>:日期
<type>:类型
<format>:格式
<identifier>:标识符
<source>:来源
<language>:语种
<relation>:相关信息
<coverage>:履盖范围
<rights>:权限描述
<x-metadata>,即扩展元素。如果有些信息在上述元素中无法描述,则在此元素中进行扩展。
2、<menifest>,文件列表,由于列出OEBPS文档及相关的文档,有一个子元素构成,
<item id="" href="" media-type="">,该元素由三个属性构成:
id:表示文件的ID号
href:文件的相对路径
media-type:文件的媒体类型
例如:<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">,脊骨,其主要功能是提供书籍的线性阅读次序。由一个子元素构成:
<itemref idref="">,由一个属性构成:
idref:即参照menifest列出的ID
例如:<itemref idref="page01"/>
4、<guide>,指南,依次列出电子书的特定页面, 例如封面、目录、序言等, 属性值指向文件保存地址。一般情况下,epub电子书可以不用该元素。
5、<tour>,导读。可以根据不同的读者水平或者阅读目的, 按一定次序, 选择电子书中的部分页面组成导读。一般情况下,epub电子书可以不用该元素。
content.opf实例
1、<metadata>,元数据信息,由两个子元素组成:
<dc-metadata>,其元素构成采用dubline core(DC)的15项核心元素,包括:
<title>:题名
<creator>:责任者
<subject>:主题词或关键词
<description>:内容描述
<contributor>:贡献者或其它次要责任者
<date>:日期
<type>:类型
<format>:格式
<identifier>:标识符
<source>:来源
<language>:语种
<relation>:相关信息
<coverage>:履盖范围
<rights>:权限描述
<x-metadata>,即扩展元素。如果有些信息在上述元素中无法描述,则在此元素中进行扩展。
2、<menifest>,文件列表,由于列出OEBPS文档及相关的文档,有一个子元素构成,
<item id="" href="" media-type="">,该元素由三个属性构成:
id:表示文件的ID号
href:文件的相对路径
media-type:文件的媒体类型
例如:<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">,脊骨,其主要功能是提供书籍的线性阅读次序。由一个子元素构成:
<itemref idref="">,由一个属性构成:
idref:即参照menifest列出的ID
例如:<itemref idref="page01"/>
4、<guide>,指南,依次列出电子书的特定页面, 例如封面、目录、序言等, 属性值指向文件保存地址。一般情况下,epub电子书可以不用该元素。
5、<tour>,导读。可以根据不同的读者水平或者阅读目的, 按一定次序, 选择电子书中的部分页面组成导读。一般情况下,epub电子书可以不用该元素。
content.opf实例
<?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"xmlnspf="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/XMLSchema-instance"> <dc:title>数字档案馆理论与技术研究</dc:title> <dc:creator>金更达</dc:creator> <dc:subject>数字档案馆</dc:subject> <dc:subject>电子文件管理</dc:subject> <dc:subject>元数据</dc:subject> <dc:subject>数字化</dc:subject> <dc:subject>档案化</dc:subject> <dc:description>当……<dc:description> <dc:publisher>机械工业出版社</dc:publisher> <dc:contributor/> <dc:date>2007-09</dc:date> <dc:type>普通图书</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>机械工业出版社版权所有</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>
相关文章推荐
- epub格式电子书剖析之二:OPF文件构成
- .OPF文件剖析
- epub格式电子书剖析之二:OPF文件构成
- Hadoop中HDFS写入文件的原理剖析
- beanstalk源码剖析——文件结构和启动程序
- Tomcat集群Cluster实现原理剖析[转] 文件同步
- 深入剖析PE文件
- android 无法生成R文件的原因剖析
- Excel 电子表格文件格式剖析
- 文件上传显示进度条的原理剖析和代码实现
- 嵌入式 Linux 虚拟系统文件交换器剖析
- SQLserver数据文件(MDF)的页面文件头结构剖析
- 深入剖析PE文件 (告诉你exe文件打开后是依据什么来创建进程并在系统中运行)
- 【初级算法剖析】超大文件获取顺序相关数据问题
- epub格式电子书剖析之三:NCX文件构成
- (转)深入剖析之通过IAR MAP文件查看目标文件内存分配
- 剖析VC中的文件操作
- Linux 文件系统剖析: Linux SCSI 子系统剖析 分层 SCSI 架构简介
- AndroidManifest.xml文件剖析 (一)
- 剖析Docker文件系统:Aufs与Devicemapper