fix a bug in svgToString function:
some elements have no attribute, so when convert it to stinrg some namespace can't be set correctly. now, the tag like this can be correctly converted: <se:mytag>hello</se:mytag> git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2517 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
7b986e56ef
commit
089f061641
|
@ -4120,6 +4120,13 @@ this.svgToString = function(elem, indent) {
|
|||
// Check elements for namespaces, add if found
|
||||
$(elem).find('*').andSelf().each(function() {
|
||||
var el = this;
|
||||
// for some elements have no attribute
|
||||
var uri = this.namespaceURI;
|
||||
if(uri && !nsuris[uri] && nsMap[uri] && nsMap[uri] !== 'xmlns' && nsMap[uri] !== 'xml' ) {
|
||||
nsuris[uri] = true;
|
||||
out.push(" xmlns:" + nsMap[uri] + '="' + uri +'"');
|
||||
}
|
||||
|
||||
$.each(this.attributes, function(i, attr) {
|
||||
var uri = attr.namespaceURI;
|
||||
if (uri && !nsuris[uri] && nsMap[uri] !== 'xmlns' && nsMap[uri] !== 'xml' ) {
|
||||
|
|
Loading…
Reference in New Issue