Hallo Thorsten,
alle Versuche, auf den SVG-DOM zuzugreifen, scheitern kläglich.
Probiere es in der genannten embed-Variante
<body onload="SVGTest()">
<embed name="Example1" width="750" height="300" src="test.svg" type="image/svg+xml">
</body>
mit diesem eingebundenen SVG-Dokument
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="full">
<circle cx="50" cy="50" r="20" fill="#F00"/>
</svg>
und folgender JS-Testfunktion
function SVGTest()
{
var svgns="http://www.w3.org/2000/svg";
var svgdoc=document.embeds["Example1"].getSVGDocument();
var svgroot=svgdoc.documentElement;
var myrect=svgdoc.createElementNS(svgns,"rect");
myrect.setAttribute("x","100");
myrect.setAttribute("y","15");
myrect.setAttribute("width","150");
myrect.setAttribute("height","75");
myrect.setAttribute("fill","#090");
svgroot.appendChild(myrect);
}
Neben dem statischen roten Kreis sollte dynamisch ein grünes Rechteck folgen, auch im Firefox.
Grüße,
Thomas