-- 作者:unicornwhy
-- 发布时间:1/26/2007 5:33:00 PM
-- [求助]用MSXML解析SVG的两个问题
我用的是MSXML4.0,对SVG没什么了解,公司项目需要,没想到一动手就遇到问题 1.有Link的文件不能加载,就是load(filename)的时候就出错 我在SVG文件里加了下面一句 <a xlink:href="http://www.w3.org//Graphics//SVG//Overview.htm8"> 就解析不了了,删除后正常解析 2.doctype解析不正常 只要SVG文件里有doctype语句,就会解析完这句后退出 比如我的SVG文件如下: <?xml version="1.0" standalone="no" ?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> <svg width="300" height="100" xmlns="http://www.w3.org/2000/svg"> <rect x="25" y="10" width="280" height="50" fill="red" stroke="blue" stroke-width="3"/> </svg> 则解析的结果 the NO.0 Attributes version of xml is = 1.0 the NO.1 Attributes standalone of xml is = no the NO.0 Attributes PUBLIC of svg is = -//W3C//DTD SVG 1.0//EN the NO.1 Attributes SYSTEM of svg is = http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd 删除doctype语句后解析结果为: the NO.0 Attributes version of xml is = 1.0 the NO.1 Attributes standalone of xml is = no the NO.0 Attributes width of svg is = 300 the NO.1 Attributes height of svg is = 100 the NO.2 Attributes xmlns of svg is = http://www.w3.org/2000/svg the NO.0 Attributes x of rect is = 25 the NO.1 Attributes y of rect is = 10 the NO.2 Attributes width of rect is = 280 the NO.3 Attributes height of rect is = 50 the NO.4 Attributes fill of rect is = red the NO.5 Attributes stroke of rect is = blue the NO.6 Attributes stroke-width of rect is = 3
|