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