Click to See Complete Forum and Search --> : Access innerText of svg element


samiei
04-24-2007, 01:48 PM
Hi;
I have a XML document and going to transform it as HTML by XSLT. One of the fields named "graph" consists of SVG image code. I have added an EMBED object to the output HTML as below:

<embed type='image/svg+xml' src='Image.svg' onload="this.getSVGDocument().getElementsByTagName('svg')[0].innerText = '{graph}'" />

Image.svg is:

<?xml version="1.0" standalone="no"?>
<?xml-stylesheet href="SVG.css" type="text/css"?>

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg" />

But unfortunately, I may not access the innerText or innerHTML of svg element in Image.svg; Although I can read or change the attributes of this element such as "width" or "version"!?
How would I be able to show the svg image? I am looking for a way to change the innerText of svg tag from the main HTML file.
Much obliged to you for your attention.

Regards