AJAX´¦ÀíXMLÎĵµÎÊÌâ
<XML>
<FLAG>1</FLAG>
<REASON></REASON>
<ADVERT><ADID>64</ADID><ADNAME>Ó¢»ÊÓéÀÖËÄ</ADNAME><ADCONTENT>ÄÚÈÝÒ»</ADCONTENT><ADTIME>50.0</ADTIME></ADVERT>
<ADVERT><ADID>66</ADID><ADNAME>Ó¢»ÊÓéÀÖÈý</ADNAME><ADCONTENT>ÄÚÈݶþ</ADCONTENT><ADTIME>51.0</ADTIME></ADVERT>
</XML>
ÎÒÌá½»ÓõÄÊÇPOST·½·¨£¬ÈçÉÏÊÇÌá½»ºó·þÎñÆ÷¶Ë·µ»ØµÄXMLÎı¾£¬ÎÒͨ¹ýÏÂÃæ·½·¨À´»ñÈ¡ÎĵµÄÚÈÝ£¬£º
//AJAXÏìÓ¦´¦Àíº¯Êý
function doProcess(){
if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
//´´½¨XML¶ÔÏó
var xmlDoc = xmlHttp.responseXML;//²âÊÔxmlDocÊǶÔÏó
//var testStr = xmlHttp.responseText;//testStr ¼´ÎªÉÏÃæ³öÏÖµÄXMLÎı¾
alert(xmlDoc.childNodes[0]);//µ«ÊÇËûµÄ×Ó½ÚµãΪnull
var flag = xmlDoc.getElementsByTagName("ADVERT");
alert(flag.length);//Êä³öΪ0£¬ÎªÊ²Ã´²»ÊÇ1
if(flag[0].firstChild.nodeValue==1){ //ÕâÀï¾ÍÖ±½Ó±¨´í˵¶ÔÏó²»´æÔÚÁË¡£¡£
var reason = xmlDoc.getElementsByTagName("REASON");
alert(reason[0].firstChild.nodeValue);
}
}
}
}
Çë°ïÎÒ·ÖÎöÏ£¬ÎªÊ²Ã´µÃµ½µÄ²»ÊÇÎÒÔ¤ÆÚµÄ½á¹û
ÿÌì»ØÌû¼´¿É»ñµÃ10·Ö¿ÉÓ÷Ö
ÊÔÊÔ
var xml = xmlDoc.documentElement;
alert(xml.childNodes.length);
2Â¥µÄ·½·¨ÎÒÓùýµÄ£¬Îª
Ïà¹ØÎÊ´ð£º
ÎÒÏÖÔÚÓÃstruts2¿ò¼Ü,ÐèҪʹÓÃajaxʵÏÖ¾Ö²¿Ë¢Ð£¬µ«ÊÇ´ÓÈÝÆ÷Àï·µ»ØµÄÖµ²»ÖªµÀÔõô´Óstruts.xmlÅäÖÃÎļþÀïÓ³Éäµ½jspÒ³ÃæÀÒÔǰservletÀïдout.orint("xxxxx")¾Í¿ÉÒԵõ½~£¬µ«ÊÇÏÖÔÚÓÃstruts¾Í²»ÖªµÀÔõôР......
txt ºÍXML ¸ñʽÏàÓ¦
²»½èÖúDataSet
µ¼Èë¶ÁÈ¡TXTÎļþ
È»ºóÖ±½ÓдÈëXML(ͬһÎļþ,²»Í¬Êý¾Ý,µÝÔöÔÊý¾ÝûÓб»¸²¸ÇÇé¿öÏÂÔö¼ÓÊý¾Ý.)
½Ì¸öÒªµã»ò×îºÃÊÇÓиö´úÂëÌáʾµÄ
¹ý·ºÃºº °ï¸öæÈö^^
²»»á£¬°ïÂ¥Ö÷ ......
Êý¾Ý¿â±íÖÐÓÐÒ»ÁУ¨TranXml£©ÀàÐÍÊÇxml£¬´æ´¢µÄÊÇÀàËÆ
<fathernode>
<a>aaa
</a>
<b>bbb
</b>
</fathernode>
µÄÐÅÏ¢£¬²¢ÇÒͨ¹ý²éѯ·½· ......
ÎÒµÄajaxµÄupdatepanel¿Ø¼þÀïµÄÃæ²»ÄÜÖ´ÐÐresponse.write£¬¿ÉÊÇÎÒÐèÒªµ¯³ö¶Ô»°¿ò£¬ÎÒÒªÔõô×öÄØ£¿
ÓÐûÓв»ÐèÒªresponse.writeµ¯Ìáʾ¿òµÄ×ö·¨ÄØ£¿
ÁíÍâÎÒµÄÒ³ÃæÉÏÓÐÒ»¸öwebÓû§¿Ø¼þ£¬È»ºó·ÅÒ»¸ögridviewÔÚupdatepa ......
ÒÑÖªÎļþ1.xmlºÍÊý¾ÝÎļþdb.xml£¬ÈçºÎÓÃjava±àд³ÌÐò£¬µÃ³ö2.xmlÎļþ£¿
1.ÒÑÖªxmlÎļþ 1.xml½á¹¹ÈçÏ£º
<cs>
<cs name="cs1" details="This is cs1" country="China&q ......