SVG Import: Fix namespacing issues introduced by #984

This commit is contained in:
Jürg Lehni 2016-02-19 23:30:54 +01:00
parent b71e3a44d9
commit acb1e408d0

View file

@ -18,8 +18,8 @@
var SvgElement = new function() { var SvgElement = new function() {
// SVG related namespaces // SVG related namespaces
var svg = 'http://www.w3.org/2000/svg', var svg = 'http://www.w3.org/2000/svg',
xmlns = 'http://www.w3.org/2000/xmlns/', xmlns = 'http://www.w3.org/2000/xmlns',
xlink = 'http://www.w3.org/1999/xlink/', xlink = 'http://www.w3.org/1999/xlink',
// Mapping of attribute names to required namespaces: // Mapping of attribute names to required namespaces:
attributeNamespace = { attributeNamespace = {
href: xlink, href: xlink,
@ -47,7 +47,7 @@ var SvgElement = new function() {
if (typeof value === 'number' && formatter) if (typeof value === 'number' && formatter)
value = formatter.number(value); value = formatter.number(value);
if (namespace) { if (namespace) {
node.setAttributeNS(namespace, name, value); node.setAttributeNS(namespace + '/', name, value);
} else { } else {
node.setAttribute(name, value); node.setAttribute(name, value);
} }