SVG错误:根元素命名空间与请求的不匹配

时间:2017-03-06 19:32:20

标签: svg batik

我在尝试使用Apache的Batik库将SVG文件加载到我的java应用程序时遇到以下错误:

java.io.IOException: Root element namespace does not match that requested:
Requested: http://www.w3.org/2000/svg
Found: null

我知道这个问题被问到here,但OP的解决方案是删除无效元素。

有没有人对此错误有任何其他了解?下面是导致异常的svg文件:

<div id="MapMarker">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="41 -24 118 178" width="118" height="178" version="1.2" baseProfile="tiny">
        <path fill="rgb(255, 128, 128)" fill-opacity="1" stroke="black" stroke-width="4" d="M 45 150 L 45 70 L 100 20 L 155 70 L 155 150" />
        <path fill="rgb(255, 255, 128)" stroke="black" stroke-width="4" d="M 90 135 l 0 -10 l 5 -5 l 0 -55 l 5 -5 l 5 5 l 0 55 l 5 5 l 0 10 l -10 -10 Z" />
        <text font-family="Arial" font-size="30" font-weight="bold" fill="black" stroke="none" stroke-width="4" text-anchor="middle" x="68" y="110">S</text>
        <text font-family="Arial" font-size="30" font-weight="bold" fill="black" stroke="none" stroke-width="4" text-anchor="middle" x="132" y="110">A</text>
        <g fill="none" stroke="black" stroke-width="4" transform="translate(0)">
            <path d="M 100 10 L 100 -15" />
            <path d="M 120 10 L 120 -15" />
            <path d="M 80 10 L 80 -15" />
        </g>
    </svg>
</div>

0 个答案:

没有答案
相关问题