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/