Hi, I'm not sure what you're trying to acheive her. I get rid of all Inkscape's namespaces (now you can do it by simply choosing "Optimized SVG" from Inkscape's "Save as" dialouge box) and then add the JavaScript.
Richard Pearman http://www.pixelpalaces.com/ The next stage in the evolution of web comics: http://www.onlinecomics.net/pages/details/listing.php?comicID=4415 Read my Helium articles: http://www.helium.com/users/212199 South Alberta Cactus and succulent society: http://www.facebook.com/group.php?gid=20360241008 Make money from discussing things: http://www.myLot.com?ref=Graptopetalum --- In [email protected], "Arjen" <arjenmeijernl@...> wrote: > > Greetings from The Netherlands, > > I am writing a small program to animate a basketball game. > See b.alforto.nl. Press the blue button to see the svg animation. > > My question is simple. I am trying to generate a inkscape file with layers > with javascript in a browser. Inkscape uses namespaces. What is the correct > solution to use namespaces? > > Can anybody point me to an example? > > Arjen > > Very specific: > > var padspeler =createSVGElement({element:"g",groupmode:'layer',id:"laag"+nr, > label:'Beweging speler'+nr,appendTo:padenininkscape}); > > is correct but does nothing in Inkscape. > > Adding a namespaces gives errors due to different namespaces. How can I for > once and for all solve this problem? > > var padspeler > =createSVGElement({element:"g","inkscape:groupmode":'layer',id:"laag"+elem.nummer,"inkscape:label":'Beweging > speler'+elem.nummer, appendTo:padenininkscape}); > > createSVGElement is taken from > http://www.dotuscomus.com/svg/lib/tinytools/domHelper_2.es create nodes > function createSVGElement (o) { > for (var p in o) { > var value = o[p]; > switch(p) { > case "element" : var element = SVGDocument.createElementNS(ns.svg, > value); > break; > case "textNode" : > element.appendChild(SVGDocument.createTextNode(value)); > break; > case "appendTo" : value.appendChild(element); > break; > default : element.setAttributeNS((p == "xlink:href") ? ns.xlink : null, > p, value); > } > } > return element; > } > ------------------------------------ ----- 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: [email protected] [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/

