When serializing, use nodename (which includes namespace prefix). Patch by Jacques Distler

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1393 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Jeff Schiller 2010-02-16 18:32:50 +00:00
parent c8d5ba7b7e
commit d6037a742e
1 changed files with 8 additions and 13 deletions

View File

@ -1514,14 +1514,10 @@ function BatchCommand(text) {
$.inArray(attr.localName, ['width','height','xmlns','x','y','viewBox','id','overflow']) == -1)
{
out.push(' ');
// map various namespaces to our fixed namespace prefixes
// (the default xmlns attribute itself does not get a prefix)
if(attr.namespaceURI) {
out.push(nsMap[attr.namespaceURI]+':');
if(!attr.namespaceURI || nsMap[attr.namespaceURI]) {
out.push(attr.nodeName); out.push("=\"");
out.push(attrVal); out.push("\"");
}
out.push(attr.localName); out.push("=\"");
out.push(attrVal); out.push("\"");
}
}
} else {
@ -1543,19 +1539,18 @@ function BatchCommand(text) {
&& elem.nodeName == 'image'
&& attr.localName == 'href'
&& save_options.images
&& save_options.images == 'embed') {
&& save_options.images == 'embed')
{
var img = encodableImages[attrVal];
if(img) attrVal = img;
}
// map various namespaces to our fixed namespace prefixes
// (the default xmlns attribute itself does not get a prefix)
if(attr.namespaceURI && attr.localName != "xmlns") {
out.push(nsMap[attr.namespaceURI]+':');
if(!attr.namespaceURI || nsMap[attr.namespaceURI]) {
out.push(attr.nodeName); out.push("=\"");
out.push(attrVal); out.push("\"");
}
out.push(attr.localName); out.push("=\"");
out.push(attrVal); out.push("\"");
}
}
}