//获取XmlHttpRequest对象
function GetXmlHttp()
{
  var xmlhttp=null;
  try
  {
    // 其他浏览器
    xmlhttp=new XMLHttpRequest();
  }
  catch (e)
  {
    // 微软IE
    try
    {
      xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e)
    {
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  return xmlhttp;
}

//获取Xml文件对象
function GetXmlDoc(doc) 
{
  try
  {
    // 微软IE
    xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  }
  catch(e)
  {
    // 其他浏览器
    xmlDoc=document.implementation.createDocument("","",null);
  }
  xmlDoc.async=false;
  xmlDoc.load(doc);
  return xmlDoc;
}

//获取Xml字符串对象
function GetXmlText(text) 
{
  try
  {
    // 微软IE
    xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    xmlDoc.async=false;
    xmlDoc.loadXML(text);
  }  
  catch(e)
  {
    // 其他浏览器
    parser=new DOMParser();
    xmlDoc=parser.parseFromString(text,"text/xml");
  }
  return xmlDoc;
}
