【发布时间】:2012-12-11 19:40:53
【问题描述】:
我正在尝试为 SVG 中的 foreignObject 标记正确实现 switch 标记,以便 Internet Explorer 可以显示其他内容(在 IE 中没有什么新功能,总是忽略功能)。文档几乎非常清楚地说明了如何做到这一点:
<switch>
<!-- Process the embedded XHTML if the requiredExtensions attribute
evaluates to true (i.e., the user agent supports XHTML
embedded within SVG). -->
<foreignObject width="100" height="50"
requiredExtensions="http://example.com/SVGExtensions/EmbeddedXHTML">
<!-- XHTML content goes here -->
<body xmlns="http://www.w3.org/1999/xhtml">
<p>Here is a paragraph that requires word wrap</p>
</body>
</foreignObject>
<!-- Else, process the following alternate SVG.
Note that there are no testing attributes on the 'text' element.
If no testing attributes are provided, it is as if there
were testing attributes and they evaluated to true.-->
<text font-size="10" font-family="Verdana">
<tspan x="10" y="10">Here is a paragraph that</tspan>
<tspan x="10" y="20">requires word wrap.</tspan>
</text>
这个例子很好,很清楚,展示了如何使用 requiredExtensions 属性。但是,超链接“http://example.com/SVGExtensions/EmbeddedXHTML”对我来说毫无意义。为了表明 XHTML 是这个 foreignObject 的 requiredExtension,我必须用什么代替它?
【问题讨论】:
标签: svg