tfessant
03-16-2005, 11:00 AM
Hello,
I have a problem for accessing DOM properties and methods of an "included" SVG file via Javascript. I am using IE and ASV 6 beta.
Configuration
- 1 - html file with usual <embed> tag : <embed id="parentSVG" type="image/svg+xml" src="../svg/parentSVG.svg" name="parentSVG" />
- 2 - first SVG file named "parentSVG.svg" which contains several elements and a reference to a second SVG file with the <use> element, looks like this :
...
<circle id="geo_22093" cx="295" cy="173" r="5" style="stroke: black; fill: red; fill-opacity: 1;" />
<use id="usegeo_1" xlink:href="region2geoloc_1.svg#geoloc_1" style="display: none;" />
...
- 3 - referenced ("included") SVG file named "region2geoloc_1.svg", containing a tag named geoloc_1, this is just the tag I want to manipulate via DOM Javascript.
...
<g id="geoloc_1" style="display: block;">
...
Via Javascript, access to DOM properties or methods of "parent" svg file works fine, i.e parentSVGdocument.getElementById("").getAttribute(".....") is OK.
But, I can't access DOM properties or methods of "referenced" svg file. In fact, I don't know how to access the geoloc_1 element in my javascript functions (these functions are called from the html file).
Please let me know if you have the solution. Many Thanks.
Thierry
I have a problem for accessing DOM properties and methods of an "included" SVG file via Javascript. I am using IE and ASV 6 beta.
Configuration
- 1 - html file with usual <embed> tag : <embed id="parentSVG" type="image/svg+xml" src="../svg/parentSVG.svg" name="parentSVG" />
- 2 - first SVG file named "parentSVG.svg" which contains several elements and a reference to a second SVG file with the <use> element, looks like this :
...
<circle id="geo_22093" cx="295" cy="173" r="5" style="stroke: black; fill: red; fill-opacity: 1;" />
<use id="usegeo_1" xlink:href="region2geoloc_1.svg#geoloc_1" style="display: none;" />
...
- 3 - referenced ("included") SVG file named "region2geoloc_1.svg", containing a tag named geoloc_1, this is just the tag I want to manipulate via DOM Javascript.
...
<g id="geoloc_1" style="display: block;">
...
Via Javascript, access to DOM properties or methods of "parent" svg file works fine, i.e parentSVGdocument.getElementById("").getAttribute(".....") is OK.
But, I can't access DOM properties or methods of "referenced" svg file. In fact, I don't know how to access the geoloc_1 element in my javascript functions (these functions are called from the html file).
Please let me know if you have the solution. Many Thanks.
Thierry