SVG支持多少级别的递归? [英] How many levels of recursion does SVG support?

查看:82
本文介绍了SVG支持多少级别的递归?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不能超过2个等级. (已在Iceweasel和Chromium上试用过.)

I cannot get past 2 levels. (Tried on Iceweasel and Chromium.)

作为测试,我尝试了此先前答复中提供的代码的变体.该文件由3个单独的文件组成,其中a.svg包括b.svg,而b.svg包括c.svg. (注意: 这不是周期.)

As a test, I tried a variant of the code presented in this earlier reply. This one consists of 3 separate files, where a.svg includes b.svg, and b.svg includes c.svg. (NB: This is not a cycle.)

<!-- a.svg -->
<svg width="100%" height="100%" viewBox="-100 -100 200 200" version="1.1"
     xmlns="http://www.w3.org/2000/svg"
     xmlns:xlink="http://www.w3.org/1999/xlink">
  <circle cx="-50" cy="-50" r="30" style="fill:#b58900" />
  <image x="10" y="20" width="80" height="80" xlink:href="b.svg" />
</svg>

<!-- b.svg -->
<svg width="100%" height="100%" viewBox="-100 -100 200 200" version="1.1"
     xmlns="http://www.w3.org/2000/svg"
     xmlns:xlink="http://www.w3.org/1999/xlink">
  <circle cx="-50" cy="-50" r="30" style="fill:#cb4b16" />
  <image x="10" y="20" width="80" height="80" xlink:href="c.svg" />
</svg>

<!-- c.svg -->
<svg width="100%" height="100%" viewBox="-100 -100 200 200" version="1.1"
     xmlns="http://www.w3.org/2000/svg"
     xmlns:xlink="http://www.w3.org/1999/xlink">
  <circle cx="-50" cy="-50" r="30" style="fill:#dc322f" />
</svg>

我希望看到一个大的深黄色点,一个中等大小的橙色点和一个小的红色点,但是我只看到前两个.实际上,我看到的内容与b.svg不包含c.svg的内容完全相同.

I expected to see a large dark yellow dot, a medium-sized orange dot, and a small red dot, but I see only the first two. In fact, what I see is exactly the same as what I would see if b.svg did not include c.svg.

为什么不包含c.svg?

有没有一种方法可以使SVG递归在2个以上的级别上正常工作?

Is there a way to get SVG recursion to work for more than 2 levels?

推荐答案

SVG用作图像时,必须在单个文件中完整.

SVG when used as an image must be complete in a single file.

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆