Hi, i am doing an application where i need to change the contents of the SVG Document dynamically using DOM in javascript based on information recieved from the server. i am able to do some of it but in some case i dont know how to do it.
Basically i have the following as the root element in SVG document. 1. <svg xmlns="http://www.w3.org/2000/svg" onload='Init(evt)' onmousemove='GetTrueCoords(evt); ShowTooltip(evt, true)' onmouseout='ShowTooltip(evt, false)'> Now based on server information i keep on adding new anchor elements to this svg root like this 2. var svgNS = "http://www.w3.org/2000/svg"; var anchorEl = SVGDocument.createElementNS(svgNS, 'a'); anchorEl.setAttributeNS(null, 'id', 'mydiv11'); var circleEl = SVGDocument.createElementNS(svgNS, 'circle'); circleEl.setAttributeNS(null, 'cx', x1); circleEl.setAttributeNS(null, 'cy', y1); circleEl.setAttributeNS(null, 'r', '15'); circleEl.setAttributeNS(null, 'fill', 'yellow'); circleEl.setAttributeNS(null, 'stroke', 'blue'); circleEl.setAttributeNS(null, 'stroke-width', '2'); circleEl.addEventListener("click", function(event) { OnMouseClick('WORLD', 'mydiv1', '512', '384') }, false); var titleEl = SVGDocument.createElementNS(svgNS, 'title'); var titleText = SVGDocument.createTextNode('ASIA'); titleEl.appendChild(titleText); circleEl.appendChild(titleEl); anchorEl.appendChild(circleEl); SVGRoot.appendChild(anchorEl); Suppose i placed a circle shape in the SVG document like this and when i click the server brings some information say continents in the world. i added all these continents around this circle dynamically by generating new anchor elements n adding to the root SVG document. Now if i click any continent, server bring all the contries in a continent say ASIA. Now my problem is, i want to wipe of all the previous anchor elements attached to the root SVG element and generate new anchor elements and attach to the root SVG element. i mean is there any method in dom like get all the anchor elements and then i can remove these and add new elements. Thanks for any suggestions, pramod. ------------------------ Yahoo! Groups Sponsor --------------------~--> Home is just a click away. Make Yahoo! your home page now. http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/1U_rlB/TM --------------------------------------------------------------------~-> ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

