如何在OPF文件中添加类型元数据元素?

时间:2015-06-24 12:37:28

标签: epub3

我在OPF文件中添加了以下内容。

<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" xml:lang="en" unique-identifier="pub-id">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
    <dc:type>ePub</dc:type>
</metadata>

Epub验证器导致错误。 http://validator.idpf.org/

element "dc:type" not allowed here; expected the element end-tag or element "dc:contributor", "dc:coverage", "dc:creator", "dc:description", "dc:format", "dc:identifier", "dc:language", "dc:publisher", "dc:relation", "dc:rights", "dc:subject", "dc:title", "link" or "meta"

如何在type文件中添加OPF元数据元素?

1 个答案:

答案 0 :(得分:1)

打包文档(.opf)

包文档包含有关该书的信息,包括元数据,清单和

脊柱。它还定义版本必须为3.0。

<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="bookid" version="3.0" prefix="rendition: http://www.idpf.org/vocab/rendition/#">

元数据

最低要求,您必须包含以下项目。

  • 标题

  • ID

  • 语言

  • 类型

  • 修饰的日期

例如:

<dc:title>XXXXXX</dc:title>
<dc:creator>YYYYYY</dc:creator>
<dc:source>0000000</dc:source>
<dc:identifier id="p0000000">URN:ISBN:0000000<dc:identifier>
<dc:publisher>ZZZZZZ</dc:publisher>
<dc:language>en</dc:language>
<dc:type>Text</dc:type>
<dc:format>100 pages</dc:format>