Jineeshjohn’s Blog

Archive for the ‘XML’ Category

This function can be used for returning xml document by passing a xml String

function xmlDataLoader(xmlData) {
	if ( window.ActiveXObject ) {
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async="false";
		xmlDoc.loadXML(xmlData);
		return xmlDoc; 
	}else if ( document.implementation && document.implementation.createDocument ) {
		parser=new DOMParser();
		xmlDoc=parser.parseFromString(xmlData,"text/xml");
		return xmlDoc;
	}
	return xmlObject;
}

Advertisements


  • None
  • No comments yet

Categories