Re: SVG in SVG

Hi Christian,

> Now it is not possible to use one SVG in a other SVG in a case of making a instace of it and changeing attributes.
> I don't see a way to do this now only with SVG.

Cameron has already hinted towards few possibilities. Nevertheless, if
you are looking into (very) simple (and pretty limited also) attribute
changes, you may try the "use" element [1]. One may declare it
externally [2] and some simple attributes, such as color [3] and
coordinates [4] (including transform) can be manipulated. Note that
the element inherits few general properties (such as styling
information), so a clever usage can lead to interesting results. Also
note that, unfortunately, referencing external resources isn't yet
widely supported across implementations (for example, Firefox 3.0.x
doesn't seem to handle them [2]).


> Also helpful would be a event "attributeChanged".

Yes, that would sound interesting -- I'm not sure if this is already
addressed in XBL 2.0 for parameterized content. Note that for general
content you already have DOM2 Mutation events [5], from which SVG an
interesting subset [6] which should be sufficient for most usages (in
this case "DOMAttrModified" seems to be appropriate). Note that,
unfortunately, this is also a feature which wasn't (isn't?) yet widely
supported across implementations (for example, as far as I know, the
defunct Adobe SVG Viewer never supported this quite powerful
mechanism).


Hope this helps,
 Helder


[1] http://www.w3.org/TR/SVG11/struct.html#UseElement
[2] http://www.w3.org/Graphics/SVG/Test/20061213/htmlObjectHarness/full-struct-use-05-b.html
[3] http://www.w3.org/Graphics/SVG/Test/20061213/htmlObjectHarness/full-struct-use-01-t.html
[4] http://www.w3.org/Graphics/SVG/Test/20061213/htmlObjectHarness/full-struct-use-03-t.html
[5] http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-mutationevents
[6] http://www.w3.org/TR/SVG11/svgdom.html#RelationShipWithDOM2Events

Received on Friday, 15 May 2009 05:33:09 UTC