Hi folk,

 

I have posted this question on yahoo group (svg-developers), but I guess the best place to post it, is in here.

 

I would like to dynanically insert the content of a svg in my main svg

But when doing the getURL, in the callback,

 

I got the following Error "Null is not a GraphicsNode" when Batik
1.5.1 is doing the appendChild, (after the parseXML, see code below)

I know that appendChild() is working in Batik when doing a
CreateElement, but how to insert the content of an svg, or a string
like '<g id="mygroup"><rect id="myrect" .../>...</g>'?

Cheers,

Benjamin

---

function getCallbackHandler(grp){
var cb = function(urlRequestStatus)
{
var string='';
if (urlRequestStatus.success)
{
string=urlRequestStatus.content;
}else{return;}
var docFragment=parseXML(string, document);
var content = document.getElementById (cb.insertAfter);
content.appendChild(docFragment);
}
cb.insertAfter=grp;
return cb;
}

function addLayer(url, grp){
getURL(url,getCallbackHandler(grp));
}

 

 

Reply via email to