Insert image into SVG document

Hi!, i have a question, is it possible insert a image into svg document when for example I do click in a link?

I tried with a java script function like this

function DImagen(nomI, idI)

{

//nomI - image name

//idI - document UniqID

contador[7]++;

var url=“/”+form.dbname.value+“/0/”+idI+“/$file/”+nomI;

var imagen = svgDocument.createElementNS(svgNS,“image”);

imagen.setAttributeNS(null,“id”,“imagen”+contador[7]);

imagen.setAttributeNS(null,“x”,200);

imagen.setAttributeNS(null,“y”,200);

imagen.setAttributeNS(null,“width”,500);

imagen.setAttributeNS(null,“height”,500);

imagen.setAttributeNS(null,“xlink:href”,url);

imagen.setAttributeNS(null,“preserveAspectRatio”,“none”);

svgRoot.appendChild(imagen);

}

I call it in a view

This view have a column with this

nom:=nImagen;{field with the name of the image}

archivo:=@AttachmentNames;

ID:=@Text(@DocumentUniqueID);

funcion:=“DImagen('”+archivo+“‘,’”+ID+“');”;

“{<a href="javascript: “+funcion+”" >”+nom+“]”

but it doesn’t work someone can help me?