ok, then just document.documentElement.appendChild(newElement); or document.rootElement.appendChild(newElement);
should both work, where newElement is a valid node reference to an SVG element. Andreas --- In [email protected], "Aaron Gray" <[EMAIL PROTECTED]> wrote: > > I did not explain that very well. > > What I want is to be able to access the svg DOM document root to be able to add DOM elements to that using javascript/ECMAScript, > > Rather than explicity creating a <g> element in SVG XML then adding child elements to that via DOM. > > Aaron > > ----- Original Message ----- > From: Aaron Gray > To: svg-developers > Sent: Thursday, January 25, 2007 7:49 PM > Subject: [svg-developers] Finding document root to add elements to. > > > At the moment I am using :- > > <svg xmlns="http://www.w3.org/2000/svg" > xmlns:xlink="http://www.w3.org/1999/xlink" > version="1.1" > xml:space="preserve" > viewBox="0 0 1000 1000" > onload="Initialize( evt)" > > > > <g id="Chart" fill-opacity="0.7" stroke="black" stroke- width="0.075cm"/> > > ~~~ > > function Initialize( LoadEvent) > { > SVGDocument = LoadEvent.target.ownerDocument; > > var g = SVGDocument.getElementById("Chart"); > > ... > > } > > How can I access the SVG DOM root element inorder to add the chart <g> element using DOM ? > > Many thanks in advance, > > Aaron > > [Non-text portions of this message have been removed] > > > > > > > -------------------------------------------------------------------- ---------- > > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.410 / Virus Database: 268.17.11/652 - Release Date: 25/01/2007 > > > [Non-text portions of this message have been removed] > ----- 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/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> 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/

