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