案例:XML DOM案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<script type="text/javascript" src="/example/xdom/loadxmldoc.js"></script>
4
</head>
5
<body>
6
7
<script type="text/javascript">
8
9
xmlDoc=loadXMLDoc("/example/xdom/books.xml");
10
11
x=xmlDoc.getElementsByTagName("title")[0]
12
y=x.childNodes[0];
13
document.write(y.nodeValue);
14
15
</script>
16
</body>
17
</html>
18