abdolence / x2js

x2js - XML to JSON and back for JavaScript
1.01k stars 492 forks source link

IE \n before Turkish chars in parseFromString #43

Open Ciaodo opened 7 years ago

Ciaodo commented 7 years ago

To prevent this,

I added the below code to parseXmlString func

// IE9+ now is here if(!isIEParser) { try { parsererrorNS = parser.parseFromString("INVALID", "text/xml").getElementsByTagName("parsererror")[0].namespaceURI; } catch(err) {
parsererrorNS = null; } } else { var xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = "false"; xmlDoc.loadXML(xmlDocStr); return xmlDoc; }