Re: SVG in SVG (problem still not solved)
> Hi Guys,Please note that persistence  may work against you instead of
> I'm still waiting for some help in this area. Please suggest me a
helping you to get more feedback. Some courtesy  may help also.
> way to call SVG image in a SVG file to be opened only in firefox.I was just moving to the next thread (my mental filter has almost
blocked this thread due to the already stated persistence) but when a
quick idea came by:
1. Fetch SVG document to embed using XHR  or equivalent technique -
an utility wrapper (such as Andreas Neumann's ) may help doing this
in a way which is compatible with most SVG implementations.
2. Parse the fetched XML (there's a recent post  which may become
3. Get SVG element's children.
4. Iterate over them, filtering known elements which will probably
break your document and insert remaining into a target element
Code snippet (untested):
// NOTE: fetchedDocument is parseXML's resulting document
var svgEle = fetchedDocument.getElementsByTagName("svg").item(0);
for(var childEle = svgEle .firstChild; childEle != null; svgEle =
// do nothing - these will probably break parent document
// OK, insert this one
Known caveats with this approach:
1. Fetched document coordinate system must be compatible with host
2. Avoiding key elements will remove scripting and library (defs)
support from fetched document. Not avoiding them may break host
document (although it wasn't tested).
This may have several other issues as the approach wasn't tested -
nevertheless, it may help guiding towards the right direction! ;-)
Also, this may have already been proposed in other threads, although I
wasn't able to find much related in a quick search.
Finally, I realized this approach can be used to help implementing
external document references (use xlink:href="other.svg#myObj") for
implementations which don't support the feature yet (Firefox and other
). This could be achieved by a similar trick which was used to
overcome an ASV issue , but in this scope it would iterate over
relevant elements (mostly "use", although other elements can also use
external references for gradients and such). If someone wants to
pickup this and marsh up an implementation... :-)
Hope this helps,
- Hi, Sujana,
have you seen this post:
Looks to me like Bruce Rindahl already has a solution for what you
--- In firstname.lastname@example.org,
"sujana_jyothi" <sujana_jyothi@...> wrote:
> Hi Helder Magalhães,
> Thanks for your code snippet. I still havent tried out if it
> or not. I will try it and will get back to you. And apologies if my
> previous message was abrupt. I thought, I did speak in a requesting
> way and I did say "please suggest me".......
> Anyways, Thanks once again....