fix(xml parser): Handle whitespace around attribute =

This commit is contained in:
Hristo Deshev
2015-06-04 15:26:17 +03:00
parent b4b5b1e790
commit 2a2c0e5c31
2 changed files with 34 additions and 15 deletions

View File

@@ -263,6 +263,10 @@ function EasySAXParser() {
continue;
};
if (w===32 || (w > 8 && w<14) ) { // \f\n\r\t\v пробел
continue;
};
if (w !== 61) { // "=" == 61
//console.log('error 2');
@@ -272,7 +276,7 @@ function EasySAXParser() {
break;
};
name = s.substring(i, j);
name = s.substring(i, j).trim();
ok = true;
if (name === 'xmlns:xmlns') {
@@ -282,6 +286,14 @@ function EasySAXParser() {
w = s.charCodeAt(j+1);
while (w = s.charCodeAt(j+1)) {
if (w===32 || (w > 8 && w<14) ) { // \f\n\r\t\v пробел
j++;
} else {
break;
}
}
if (w === 34) { // '"'
j = s.indexOf('"', i = j+2 );