javascript高级程序设计》第18章 javascript与xml

18.1 浏览器对XML DOM的支持
  18.1.1 DOM2 级核心
  18.1.2 DOMParser 类型
  18.1.3 XMLSerializer 类型
  18.1.4 IE8 及之前版本中的XML
  18.1.5 跨浏览器处理XML
18.2 浏览器对XPath 的支持
  18.2.1 DOM3 级XPath
  18.2.2 IE 中的XPath
  18.2.3 跨浏览器使用XPath
18.3 浏览器对XSLT 的支持
  18.3.1 IE 中的XSLT
  18.3.2 XSLTProcessor 类型
  18.3.3 跨浏览器使用XSLT

曾经遇到过一道题目,一段xml 要写在html里面,看过这章才知道并不是像flash里面那么简单的。
如果查询都需要用到xpath那么在这个章节里面  “浏览器对xml dom支持”又是做什么用的呢?

还有xslt 是样式?

jq里面的ajax 难道是已经封装好的=.=
------------------------------5.20
本章应该很详实的介绍了js处理xml的一些细节,但是对于我的拿到题目,应该使用:
(w3school中看到)

if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.open("GET","cd_catalog.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;

document.write("<table border='1'>");
var x=xmlDoc.getElementsByTagName("CD");
for (i=0;i<x.length;i++)
  {
  document.write("<tr><td>");
  document.write(x[i].getElementsByTagName("ARTIST")[0].childNodes[0].nodeValue);
  document.write("</td><td>");
  document.write(x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue);
  document.write("</td></tr>");
  }
document.write("</table>");
原文地址:https://www.cnblogs.com/della/p/3296236.html