| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 967 人关注过本帖
标题:HTML调用XML数据集为什么显示不了啊?
只看楼主 加入收藏
pangya426
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2007-11-5
收藏
 问题点数:0 回复次数:0 
HTML调用XML数据集为什么显示不了啊?
我用HTML创建了一个表格,引用了XML数据集中的数据,可是却显示不出来,XML文件和HTML文件在同一文件夹里,外部引用
<?xml version="1.0" encoding="gb2312"?>
<class>
<title>同学通讯录</title>
<student>
<classID>网络一班</classID>
<name>张三</name>
<sex>男</sex>
<studentID>00001</studentID>
<telphone>1362456789</telphone>
<address>经济管理干部学院</address>
<xibu>计算机系</xibu>
</student>
<student>
<classID>网络一班</classID>
<name>李四</name>
<sex>男</sex>
<studentID>00001</studentID>
<telphone>1362456789</telphone>
<address>经济管理干部学院</address>
<xibu>计算机系</xibu>
</student>
<student>
<classID>网络一班</classID>
<name>王五</name>
<sex>男</sex>
<studentID>00001</studentID>
<telphone>1362456789</telphone>
<address>经济管理干部学院</address>
<xibu>计算机系</xibu>
</student>
<student>
<classID>网络一班</classID>
<name>老六</name>
<sex>男</sex>
<studentID>00001</studentID>
<telphone>1362456789</telphone>
<address>经济管理干部学院</address>
<xibu>计算机系</xibu>
</student>
<student>
<classID>网络一班</classID>
<name>赵六</name>
<sex>男</sex>
<studentID>00001</studentID>
<telphone>1362456789</telphone>
<address>经济管理干部学院</address>
<xibu>计算机系</xibu>
</student>
<student>
<classID>网络二班</classID>
<name>刘河</name>
<sex>男</sex>
<studentID>00001</studentID>
<telphone>1362456789</telphone>
<address>经济管理干部学院</address>
<xibu>计算机系</xibu>
</student>
<student>
<classID>网络一班</classID>
<name>李力</name>
<sex>男</sex>
<studentID>00001</studentID>
<telphone>1362456789</telphone>
<address>经济管理干部学院</address>
<xibu>计算机系</xibu>
</student>
<student>
<classID>网络三班</classID>
<name>王力</name>
<sex>女</sex>
<studentID>00001</studentID>
<telphone>1362456789</telphone>
<address>经济管理干部学院</address>
<xibu>计算机系</xibu>
</student>
<student>
<classID>网络一班</classID>
<name>李可</name>
<sex>男</sex>
<studentID>00001</studentID>
<telphone>1362456789</telphone>
<address>经济管理干部学院</address>
<xibu>旅游管理系</xibu>
</student>
<student>
<classID>网络一班</classID>
<name>张东</name>
<sex>女</sex>
<studentID>00001</studentID>
<telphone>1362456789</telphone>
<address>经济管理干部学院</address>
<xibu>计算机系</xibu>
</student>
<student>
<classID>网络一班</classID>
<name>左四</name>
<sex>男</sex>
<studentID>00001</studentID>
<telphone>1362456789</telphone>
<address>经济管理干部学院</address>
<xibu>计算机系</xibu>
</student>
<student>
<classID>网络一班</classID>
<name>李场</name>
<sex>男</sex>
<studentID>00001</studentID>
<telphone>1362456789</telphone>
<address>经济管理干部学院</address>
<xibu>计算机系</xibu>
</student>
<student>
<classID>网络一班</classID>
<name>王美</name>
<sex>女</sex>
<studentID>00001</studentID>
<telphone>1362456789</telphone>
<address>经济管理干部学院</address>
<xibu>计算机系</xibu>
</student>
<student>
<classID>网络一班</classID>
<name>李狗</name>
<sex>男</sex>
<studentID>00001</studentID>
<telphone>1362456789</telphone>
<address>经济管理干部学院</address>
<xibu>计算机系</xibu>
</student>
<student>
<classID>网络一班</classID>
<name>李桃</name>
<sex>女</sex>
<studentID>00001</studentID>
<telphone>1362456789</telphone>
<address>经济管理干部学院</address>
<xibu>计算机系</xibu>
</student>
</class>
以上是XML文件
以下是HTML文件
<xml ID="xmlDSO"SRC="student.xml"></xml>
<html>
<head>
<center><b><title>学生通讯录</title></b></center>
</head>
<SCRIPT language=JavaScript>
var pageno=1;
funtion SelectRecord(Element)
{
//获取记录的行数
RecordNO=Element.parentElment.rowIndex;
//建立XML的RecordSet
sqlclass=xmlDSO.recordset;
//指定当前记录集位置
sqlclass.absoluteposition=RecordNo+(pageno-1)*class110.dataPageSize;
//获取元素值
classID.innerHTML=sqlclass("classID").value;
name.innerHTML=sqlclass("name").value;
sex.innerHTML=sqlclass("sex").value;
studentID.innerHTML=sqlclass("studentID").value;
telphone.innerHTML=sqlclass("telphone").value;
address.innerHTML=sqlclass("address").value;
xibu.innerHTML=sqlclass("xibu").value;
}
function prepage()
{if(pageno>1)
{
class110.previousPage();
pageno=pageno-1;
}
}
function nextpage()
{if(pageno<sqlclass.RecordCount/sqlclass.dataPageSize)
{
class110.nextPage();
pageno=pageno+1;
}
}
</SCRIPT>
<body>
<center><b>同学通讯录</b></center>
<table ID=class001 datasrc="#xmlDSO" border="1" align="center" DatePageSize="3">
<thead>
<th>班级名称</th><th>姓名</th><th>性别</th><th>学号</th>
<th>电话</th><th>地址</th><th>系别</th>
</thead>
<tr>
<td onclick=selectrecord(this)><SPAN DATAFLD="classID"></SPAN></td>
<td onclick=selectrecord(this)><SPAN DATAFLD="name"></SPAN></td>
<td onclick=selectrecord(this)><SPAN DATAFLD="sex"></SPAN></td>
<td onclick=selectrecord(this)><SPAN DATAFLD="studentID"></SPAN></td>
<td onclick=selectrecord(this)><SPAN DATAFLD="telphone"></SPAN></td>
<td onclick=selectrecord(this)><SPAN DATAFLD="address"></SPAN></td>
<td onclick=selectrecord(this)><SPAN DATAFLD="xibu"></SPAN></td>
</tr>
</table>
<HR>
<center>
<INPUT TYPE="BUTTON"onclick="prepage()"value="上一页">
<INPUT TYPE="BUTTON"onclick="nextpage()"value="下一页">
每一页显示<INPUT TYPE="TEXT" VALUE="3" size="4" onblur="class001.DataPageSize=this.value;">个同学
</center>
<center>请单击要查询的同学</center>
<HR>
<center>姓名:<span id="name"></span></center>
<table border="1" align="center">
<tr>
<td width="50%">
班级:<span id="classID"></span><BR>
性别:<span id="sex"></span><BR>
学号:<span id="studentID"></span><BR>
</td>
<td width="50%">
电话:<span id="telphone"><BR>
地址:<span id="address"><BR>
系别:<span id="xibu"><BR>
</td>
</tr>
</table>
<HR>
</body>
</html>

谢谢了,哪个大哥帮忙解决下
搜索更多相关主题的帖子: XML数据 HTML 网络 集为 name 
2007-11-10 20:33
快速回复:HTML调用XML数据集为什么显示不了啊?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016142 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved