Fix namespace prefix problem in serializing function

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@588 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Jeff Schiller 2009-09-05 18:13:20 +00:00
parent d86d5c3518
commit 52a7216690
1 changed files with 6 additions and 1 deletions

View File

@ -801,10 +801,15 @@ function BatchCommand(text) {
attr.nodeValue = attr.nodeValue.replace(',','.');
}
out.push(" ");
// map various namespaces to our fixed namespace prefixes
// TODO: put this into a map and do a look-up instead of if-else
if (attr.namespaceURI == 'http://www.w3.org/1999/xlink') {
out.push('xlink:');
}
out.push(attr.nodeName); out.push("=\"");
else if(attr.namespaceURI == 'http://www.w3.org/2000/xmlns/' && attr.localName != 'xmlns') {
out.push('xmlns:');
}
out.push(attr.localName); out.push("=\"");
out.push(attr.nodeValue); out.push("\"");
}
}