W3C home > Mailing lists > Public > www-svg@w3.org > March 2010

Re: SVG use element and cycles

From: Alex Danilo <alex@abbra.com>
Date: Thu, 18 Mar 2010 20:11:57 +1100
Message-Id: <X70HZK.HSES4CUU8INM@abbra.com>
To: Chad Faragher <wyck@chromium.org>
Cc: www-svg@w3.org
Hi Chad,

	Yes it's allowed.

	The spec clearly states that the cycles need to be detected and
there are tests in the test suite to validate that the implementation does
not go into infinite loops.

	For example, struct-use-recursion-01-t.svg, etc.


--Original Message--:
>In SVG, the <use> element can be used to create a cycle by linking to a parent node.  Is this allowed?  How should it be handled?
>For example, here is a specific test case that is giving me some trouble.
><svg xmlns="http://www.w2.org/2000/svg">
><g id="foo">
><svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xl="http://w3.org/1999/xlink">
><use xl:href="#foo"/>
><g id="bar" />
><use xlink:href="#bar"/>
>[ Note that the first <g> tag is a start-tag, and not an empty-tag ]
>First of all, it is not well formed xml, so that's perhaps reason enough to reject it.  But even if it were well-formed XML the structure of it is strange -- I have a problem with the idea of having a <use> element refer to its own grandparent element.  This would case a cycle in my mind, and should probably be disallowed.
>What does the spec have to say about the validity of this, and specifically the potential cycles that would be created by having a <use> element refer to one of its ancestor nodes?
>- Chad
Received on Thursday, 18 March 2010 09:13:29 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:20 UTC