<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<TITLE> New Document </TITLE>
<script type="text/javascript">
function show(){
 var docXml=new ActiveXObject("Microsoft.XMLDOM");
 docXml.async=false;
 docXml.load("Demo.xml");
 var root=docXml.documentElement();
 var nodes=root.ChildNodes;
 document.getElementById("id1").innerText=nodes[0].text;
 document.getElementById("id2").innerText=nodes[1].text;
}
</script>
</HEAD><BODY onload="show();">
<h1><span id="id1">标题:</span></h1>
<h1><span id="id2">作者:</span></h1>
</BODY>
</HTML>xml文件:
<?xml version="1.0" encoding="GB2312" ?>
<myfire>
<mf>
<title uvalue="abc" uname="xml"></title>
<author>是的</author>
</mf>
</myfire>