简体   繁体   English

SVG xml:base属性在IE9中不起作用

[英]SVG xml:base attribute not working in IE9

I'm trying to create an SVG document that includes image tags referencing png files. 我正在尝试创建一个包含引用png文件的图像标签的SVG文档。 This works if I include the absolute path of the png in every image tag but if I try putting an xml:base attribute in it doesn't seem to work in IE9. 如果我在每个图像标记中都包含png的绝对路径,则此方法有效,但是如果我尝试将xml:base属性放入IE9中似乎不起作用。 However it does seem to work Firefox and Chrome. 但是,它似乎确实可以在Firefox和Chrome上运行。 Is there a bug in IE or is there something wrong with my syntax? IE中是否有错误或我的语法有问题?

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:base="file:///C:/SVG/Devices/valves/">
  <image width="40" height="56" x="10" y="10" xlink:href="motorised_valve[purple].gif"/>
</svg>

For complicated reasons I don't want to go into here, I can't put the SVG document into the same folder as the images. 由于复杂的原因,我不想进入这里,因此无法将SVG文档与图像放在同一文件夹中。

Thanks for any help Mog 谢谢您的帮助Mog

Would it be acceptable in your case to embed your PNG images in your document using the data:// protocol? 在这种情况下,使用data://协议将PNG图片嵌入文档中是否可以接受? That would solve your problem, at the expense of potentially making the XML rather large. 那可以解决您的问题,但要以可能使XML变得很大为代价。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM