dom解析xml(ajax)

function readXml() {
  var students = XMLHttpReq.responseXML.getElementsByTagName("student");
  for(var i=0;i<students.length;i++) {
   var stud = students[i];
   var name = stud.getElementsByTagName("name")[0].firstChild.data;
   var sex = stud.getElementsByTagName("sex")[0].firstChild.data;
   var high = stud.getElementsByTagName("high")[0].firstChild.data;
   var height = stud.getElementsByTagName("height")[0].firstChild.data;
   var classid = stud.getElementsByTagName("classid")[0].firstChild.data;
   document.write(name + "<p>");
   document.write(sex + "<p>");
   document.write(high + "<p>");
   document.write(height + "<p>");
   document.write(classid + "<p>");
   document.write("");
  }  
 }

 

2.http://blog.sina.com.cn/s/blog_59833db10100aecr.html  dom4j

 

Java的XML编程  http://www.pcjx.net/Java/XMLBeans/216768.html

 

http://sind.iteye.com/blog/309851

你可能感兴趣的:(java,编程,xml,Ajax,Blog)