html - 解析属性“ibooks:readaloud”的前缀“ibooks”时出错
问题描述
我正在尝试验证以下 html:
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:epub="http://www.idpf.org/2007/ops" epub:prefix="ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/">
<head>
<title>Moby-Dick</title>
<link rel="stylesheet" href="css/stylesheet.css" type="text/css"/>
<meta charset="utf-8"/>
<meta name="viewport" content="width=1024, height=600"/>
</head>
<body>
<p ibooks:readaloud="startstop">Read Aloud</p>
</body>
</html>
但我得到了错误:
Validating using EPUB version 3.0.1 rules.
FATAL(RSC-016): ./30/moby-dick-mo.epub/OPS/chapter_001.xhtml(11,41): Fatal Error while parsing file 'The prefix "ibooks" for attribute "ibooks:readaloud" associated with an element type "p" is not bound.'.
ERROR(RSC-005): ./30/moby-dick-mo.epub/OPS/chapter_001.xhtml(-1,-1): Error while parsing file 'The prefix "ibooks" for attribute "ibooks:readaloud" associated with an element type "p" is not bound.'.
我究竟做错了什么?
解决方案
必须声明 XML 名称空间前缀才能使 XML 文档具有良好的名称空间格式。您对ibooks
命名空间前缀的声明被破坏了。要修复它,请更改
epub:prefix="ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/"
至
xmlns:ibooks="http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/"
推荐阅读
- angular - 如何使用httpclient post方法将数据传递给api
- python - 如何在 tkinter 中动态删除复选框?
- amazon-web-services - AWS EC2 获取 AMI 大小
- c# - DispatcherTimer 的绑定不在 View 上显示它的值
- python - 带有 keras ocr 示例的负标签
- typescript - 使用 Vue 构建打字稿代码时 Webpack 构建错误
- git - 如何在 Git 提交 GPG 签名期间修复“无法运行 --version:没有此类文件或目录”错误
- typescript - vscode/eslint 抱怨解析错误:在声明模块中只允许声明和类型导入
- html - 行对齐中的引导程序 4 按钮
- docker - 主机到 Docker 容器远程套接字失败