svg - epubcheck : "Error while parsing file ' element "animate" not allowed here. ..”

标签 svg epub epub3

我从 v3 epub 上的 epubcheck 3.0.1 收到以下错误,

Error while parsing file 'element "animate" not allowed here; expected the element end-tag or element "desc", "metadata" or "title"'.

具有以下标记(此处已大幅删节)。

page0001.xhtml:

<?xml version="1.0"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
    <head>
        <title>Title</title>
    </head>
    <body>
        <div class="author-signature">
            <svg version="1.1" id="self-writing-author-signature" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1918.481px" height="277.577px" viewBox="0 281.535 1918.481 277.577" enable-background="new 0 281.535 1918.481 277.577" xml:space="preserve">
                <path id="sig-by" fill="none" stroke-dasharray="1057.016845703125,1057.016845703125" stroke="none" stroke-width="20" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M263.75,364.167c-7.011,19.632-21.317,39.133-42.25,45l-41.5,30c-3.824,20.125-25.998,31.36-16.174,54.457 c8.2,19.276,25.843,29.402,46.735,24.013c44.587-11.503,34.35-74.295,7.939-101.47l-4.25-45 c0.039,12.186,15.013,38.818,0.276,46.053c-10.267,5.041-27.781,27.543-40.072,18.511c-34.203-25.136-10.987-56.058-18.03-60.148 c-5.601-3.254-14.229-5.121-27.424-4.915l9.5,22.5c6.385,10.05-61.562,77.319-83.436,19.976c-11.739-30.774-5.86-78.666,22.21-98.09 c51.94-35.939,55.01,19.861,37.701,52.102C99.354,396.259,37.558,402.735,10,402.167">
                    <animate attributeName="stroke" from="none" to="#000000" begin="0" dur="100ms" fill="freeze"/>
                    <animate id="byAnim" attributeName="stroke-dashoffset" from="0" to="0" dur="1s" begin="0" fill="freeze" keySplines="0 0.5 0.5 1" calcMode="linear" values="-1057.016845703125;0"/>
                </path>
            </svg>
        </div>
    </body>
</html>

它基本上是 SVG 动画的一个片段,显示了作者自己书写的签名。

根据我所读到的内容以及我使用在线 SVG 标记验证进行的测试,SVG 很好。将动画元素作为路径元素的子元素是可以的。我对此感到不安,因为从我读到的内容来看,epubcheck 是在数字商店上发布的严峻考验,但我正在努力寻找解决此错误的方法,除了依靠数字商店的恩典来忽略这一点并继续库存。

有人可以帮忙解决上述问题吗?

最佳答案

EPUB 3 不允许使用 SVG 动画元素,请参阅:

http://www.idpf.org/epub/301/spec/epub-contentdocs.html#sec-svg-restrictions

关于svg - epubcheck : "Error while parsing file ' element "animate" not allowed here. ..”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24992734/

相关文章:

javascript - 如何在可缩放的旭日形中隐藏外圈

CSS 图像大小调整

php - PHP 的 DOMXPath 中是否需要 registerNamespace?

javascript - iBooks JavaScript 资源

epub - 如何在 Epub 中使用保存选项创建 epub 注释

javascript - Vanilla JS 将鼠标悬停在 SVG 路径上以显示 DIV?

python - 在 Python 中迭代 XML 树中的孙子

javascript - 使用 JS 更改 SVG 文本的字体大小