VBS + XML 分页问题:求救……求救……(查错)

minghui000 2004-03-08 01:41:40
就是实现不了功能,大家帮我看看到底哪里出错了?

DetachPage.xml
<?xml version="1.0" encoding="gb2312"?>
<软件>
<公司>
<公司名>Microsoft</公司名>
<开发软件>Asp</开发软件>
<开发软件I>Visual C++</开发软件I>
</公司>
<公司>
<公司名>IBM</公司名>
<开发软件>IBM no soft</开发软件>
<开发软件I>IBM no soft</开发软件I>
</公司>
<公司>
<公司名>Sun</公司名>
<开发软件>Java</开发软件>
<开发软件I>jsp</开发软件I>
</公司>
</软件>

//////////////////////////////////////////////////////////
index.htm
<HTML>
<HEAD><TITLE>xml分页</TITLE></HEAD>
<SCRIPT language="vbscript">
'下一页
sub next_onclick
if rs.absolutepage=rs.pagecount then
msgbox "已经是最后一页了"
else
rs.absolutepage=rs.absolutepage+1
no.innerhtml=rs.absolutepage
display
end if
end sub

'前一页
sub last_onclick
if rs.absolutepage=1 then
msgbox "已经是第一页了"
else
rs.absolutepage=rs.absolutepage-1
no.innerhtml=rs.absolutepage
display
end if
end sub
</SCRIPT>
<BODY>
<xml id="xmlid" src="DetachPage.xml"></xml>
<SCRIPT language="vbscript">
set rs=xmlid.recordset
rs.pagesize=2
</SCRIPT>
<div id="tablediv">asdf</div>
<SCRIPT language="vbscript">
sub display
html=" "
html="<table border='1' align='center'><thead><tr>"
hmtl=html&"<td>name</td><td>softOne</td><td>softTwo</td></tr></thead>"
for i to rs.pagesize
if i<=rs.pagesize and not rs.eof then
html=html & "<tr><td>" & rs(0) & "</td>"
html=html & "<td>" & rs(1) & "</td>"
html=html & "<td>" & rs(2) & "</td>"
html=html & "</tr>"
if i<rs.pagesize then
rs.movenext
end if
end if
next
html=html&"</table>"
tablediv.innerhtml=html
end sub
display
</SCRIPT>
<center>
当前是第
<span id="no">1</span>:页<br>
<input type="button" name="last" value="last page">
<input type="button" name="next" value="next page">
</center>
</BODY>
</HTML>

...全文
83 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复

8,906

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧