Re: [Xsltforms-support] the namespace bug?
Brought to you by:
alain-couthures
From: Evgeny G. <gaz...@gm...> - 2010-05-04 09:28:20
|
I'm fix this bug, see xsltforms.js, line 6888. I'm rewrite so: 6884 loadNS : function(node, map) { 6885 var ns = node.namespaceURI; 6886 6887 if (ns != null && typeof map[ns] == "undefined" && ns != "http://www.w3.org/XML/1998/namespace") { 6888 if (ns != "") { 6889 map[ns] = "pre" + map.length; 6890 } 6891 6892 map.length++; 6893 } 6894 ................................ And I see one more potentional bug if in model will be nodes with namespace uri equaled to "length" See line 6842: 6827 var Writer = { 6828 toString : function(node, map, init) { 6829 var st = ""; 6830 6831 if (!map) { 6832 map = {length : 0}; 6833 this.loadNS(node, map); 6834 } 6835 switch(node.nodeType) { 6836 case NodeType.ELEMENT : 6837 var name = this.name(node, map); 6838 st += "<" + name; 6839 6840 if (!init) { 6841 for (var i in map) { 6842 if (i == "length") { continue; } 6843 6844 ------- Evgeny |