Skip to content

Commit aed9e23

Browse files
committed
New version for tests.
1 parent ab8bb31 commit aed9e23

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

dist/Jsonix-all.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,12 @@ Jsonix.Class = function() {
7979
};
8080

8181
Jsonix.XML = {
82+
BUILTIN_NAMESPACE_PREFIXES : {
83+
'xmlns' : 'http://www.w3.org/2000/xmlns/',
84+
'xml' : 'http://www.w3.org/XML/1998/namespace'
85+
},
8286
XMLNS_NS : 'http://www.w3.org/2000/xmlns/',
8387
XMLNS_P : 'xmlns'
84-
8588
};
8689

8790

@@ -1590,6 +1593,11 @@ Jsonix.XML.Output = Jsonix.Class({
15901593
},
15911594
declareNamespace : function (ns, p)
15921595
{
1596+
if (Jsonix.XML.BUILTIN_NAMESPACE_PREFIXES[p])
1597+
{
1598+
// If this is a builtin namespace prefix like 'xml' or 'xmlns', do not declare it
1599+
return;
1600+
}
15931601
var index = this.pns.length - 1;
15941602
var pnsItem = this.pns[index];
15951603
var reference;

dist/Jsonix-min.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if(i===undefined){delete o.prototype.initialize
2929
}n.prototype=p;
3030
return n
3131
};
32-
Jsonix.XML={XMLNS_NS:"http://www.w3.org/2000/xmlns/",XMLNS_P:"xmlns"};
32+
Jsonix.XML={BUILTIN_NAMESPACE_PREFIXES:{xmlns:"http://www.w3.org/2000/xmlns/",xml:"http://www.w3.org/XML/1998/namespace"},XMLNS_NS:"http://www.w3.org/2000/xmlns/",XMLNS_P:"xmlns"};
3333
Jsonix.DOM={createDocument:function(){if(typeof _jsonix_xmldom!=="undefined"){return new (_jsonix_xmldom.DOMImplementation)().createDocument()
3434
}else{if(typeof document!=="undefined"&&Jsonix.Util.Type.exists(document.implementation)&&Jsonix.Util.Type.isFunction(document.implementation.createDocument)){return document.implementation.createDocument("","",null)
3535
}else{if(typeof ActiveXObject!=="undefined"){return new ActiveXObject("MSXML2.DOMDocument")
@@ -630,7 +630,8 @@ h=Jsonix.Util.Type.isNumber(h)?this.nsp[h]:h;
630630
var e,g;
631631
for(e in h){if(h.hasOwnProperty(e)){g=h[e];
632632
this.declareNamespace(e,g)
633-
}}},declareNamespace:function(j,i){var f=this.pns.length-1;
633+
}}},declareNamespace:function(j,i){if(Jsonix.XML.BUILTIN_NAMESPACE_PREFIXES[i]){return
634+
}var f=this.pns.length-1;
634635
var h=this.pns[f];
635636
var g;
636637
if(Jsonix.Util.Type.isNumber(h)){g=true;

0 commit comments

Comments
 (0)