first commit
This commit is contained in:
27
build/node_modules/xml-parse-from-string/index.js
generated
vendored
Normal file
27
build/node_modules/xml-parse-from-string/index.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
module.exports = (function xmlparser() {
|
||||
//common browsers
|
||||
if (typeof self.DOMParser !== 'undefined') {
|
||||
return function(str) {
|
||||
var parser = new self.DOMParser()
|
||||
return parser.parseFromString(str, 'application/xml')
|
||||
}
|
||||
}
|
||||
|
||||
//IE8 fallback
|
||||
if (typeof self.ActiveXObject !== 'undefined'
|
||||
&& new self.ActiveXObject('Microsoft.XMLDOM')) {
|
||||
return function(str) {
|
||||
var xmlDoc = new self.ActiveXObject("Microsoft.XMLDOM")
|
||||
xmlDoc.async = "false"
|
||||
xmlDoc.loadXML(str)
|
||||
return xmlDoc
|
||||
}
|
||||
}
|
||||
|
||||
//last resort fallback
|
||||
return function(str) {
|
||||
var div = document.createElement('div')
|
||||
div.innerHTML = str
|
||||
return div
|
||||
}
|
||||
})()
|
||||
Reference in New Issue
Block a user