用javascript操作xml(二)JavaScript 将XML转换成字符串(xml to string)


function xmlToString(xmlData) {

var xmlString;

//IE

if (window.ActiveXObject){

    xmlString = xmlData.xml;

}

// code for Mozilla, Firefox, Opera, etc.

else{

    xmlString = (new XMLSerializer()).serializeToString(xmlData);

}

return xmlString;

}

你可能感兴趣的:(JavaScript)