[FIX] QWeb2: Array-like character access in String is not supported in IE<8

bzr revid: fme@openerp.com-20120213144234-dtdw5e8ho4x85frj
This commit is contained in:
Fabien Meghazi 2012-02-13 15:42:34 +01:00
parent 16a8811930
commit f12e598b59
1 changed files with 5 additions and 2 deletions

View File

@ -241,8 +241,8 @@ QWeb2.Engine = (function() {
return true;
},
load_xml : function(s) {
s = s.replace(/^\s*|\s*$/g, '');
if (this.tools.trim(s)[0] === '<') {
s = this.tools.trim(s);
if (s.charAt(0) === '<') {
return this.load_xml_string(s);
} else {
var req = this.get_xhr();
@ -256,6 +256,9 @@ QWeb2.Engine = (function() {
req.send(null);
var xDoc = req.responseXML;
if (xDoc) {
if (!xDoc.documentElement) {
throw new Error("QWeb2: This xml document has no root document : " + xDoc.responseText);
}
if (xDoc.documentElement.nodeName == "parsererror") {
return this.tools.exception(xDoc.documentElement.childNodes[0].nodeValue);
}