我试过但没有找到如何从GET返回的XMLDocument中获取整个XML字符串的方法。SO上有很多关于如何查找或替换对象中的特定元素的问题,但我似乎找不到如何将整个文档作为字符串获取的任何答案。我正在使用的示例来自here.“用xml做点什么”部分是我目前所在的位置。我觉得这应该是微不足道的,但我不知道如何做。是否有可用于此目的的“xml.data()”或类似工具?$.ajax({url:'document.xml',type:'GET',dataType:'xml',timeout:1000,error:function(){alert('ErrorloadingXMLdocum
protectedvoidPage_Load(objectsender,EventArgse){XmlDocumentdoc=newXmlDocument();try{stringpath=Server.MapPath(".");doc.Load(path+"whatever.xml");}catch(Exceptionex){lblError.Text=ex.ToString();return;}//ConvertXMLtoaJSONstringstringJSON=XmlToJSON(doc);//Replace\with\\becausestringisbeingdecodedt
protectedvoidPage_Load(objectsender,EventArgse){XmlDocumentdoc=newXmlDocument();try{stringpath=Server.MapPath(".");doc.Load(path+"whatever.xml");}catch(Exceptionex){lblError.Text=ex.ToString();return;}//ConvertXMLtoaJSONstringstringJSON=XmlToJSON(doc);//Replace\with\\becausestringisbeingdecodedt