2011-06-04 32 views
2

据我所知,这是一个有效的SVG文件:为什么SVG 1.1基本验证失败?

<?xml version="1.0" standalone="no" encoding="UTF-8"?> 
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" 
    "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd"> 

<svg width="100%" height="100%" version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg"> 
    <rect x="0" y="0" width="50" height="50"/> 
</svg> 

该文件不会对W3C Validator验证虽然。我遇到类似125 "content model is ambiguous"的错误。我通过文件上传选项进行验证。

如何才能让我的文档生效?

如何使我的文档符合SVG Basic?

回答

2

Here是应通过验证的参考文件(其中有些文件未通过验证)。

这是一个SVG 1.1基本文件,该文件不通过验证:

<?xml version="1.0" encoding="UTF-8"?> 
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="basic" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360"> 
    <title id="test-title">color-prop-01-b</title> 
    <desc id="test-desc">Test that viewer has the basic capability to process the color property</desc> 
    <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/> 
</svg> 
+0

感谢名单,我想我的问题出在测试下:有效SVG基本1.1,使用DOCTYPE(测试目前失败,因为在问题DTD),我会尝试你的例子中描述的方法(没有DOCTYPE)。 – 2011-06-04 10:43:03

+0

看来验证器只是坏了。 – bjornd 2011-06-04 10:47:12