2011-06-04 28 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