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