+ -
当前位置:首页 → 问答吧 → html与xml整合的问题?

html与xml整合的问题?

时间:2005-09-06

来源:互联网


<html> <head> <title>文章列表与翻页</title> <style> body{ font: 12px "宋体", "Arial", "Times New Roman"; } table { font-size: 12px; border: 0px double; border-color: #99CC99 #99CC99 #CCCCCC #CCCCCC; cellpadding:3;cellspacing:3; bgcolor:#eeeeee; text-decoration: blink} DIV { font-size: 12px; color: red; } </style> </head> 数据岛: <XML ID="xmlconf"> <?xml version="1.0" encoding="GB2312"?> <notes_list> <note_list> <note_id>673</note_id> <linkurl>../tech/News_details.asp?news_ID=673</linkurl> <note_title>VBscript 类的设计(一)</note_title> <note_date>2004-10-4 8:06:00</note_date> <read_count>31</read_count> </note_list> <note_list> <note_id>672</note_id> <linkurl>../tech/News_details.asp?news_ID=672</linkurl> <note_title>VBscript 类的设计(二)</note_title> <note_date>2004-10-5 8:06:00</note_date> <read_count>850</read_count> </note_list> </notes_list> </XML> <!--第一步--> <body> <div align="center"> <p>文章列表与翻页</p> <table id="table" datasrc="#xmlconf" width="600" border="1" cellspacing="1" cellpadding="1"> <thead> <th> 编号</th> <th> 标题</th> <th> 日期</th> <th> 人数</th> <thead> <tr> <td><DIV datafld="note_id"></DIV></td> <td><div datafld="note_title"></div></td> <td><div datafld="note_date"></div></td> <td><div datafld="read_count"></div></td> </tr> </table> </div> </body> </html>
   提示:您可以先修改部分代码再运行

问题在哪里,为什么不能显示出项目来?

[ 本帖由 s_x 最后编辑于 2005-9-6 17:06 ]

作者: s_x   发布时间: 2005-09-06

呕要晕倒。。看了半天。。原来是米封闭<thead>

作者: 小男   发布时间: 2005-09-06

呵呵~~ 这些小细节很难注意到的。

作者: ※潇洒※   发布时间: 2005-09-06

原来如此,太大意了。
我还有一个问题,就是对于上面的文档,如何在用js来操作xml?
针对上面的例子,如何将access中的数据导入到xml区域中?

作者: s_x   发布时间: 2005-09-07

js 操作 XML 用 XMLDom 。

var xDOM = new ActiveXObject("Microsoft.XMLDOM");
     xDOM.async = false;
     xDOM.load(xmlObj);

access 数据用 ASP 等后台语言输出为 XML。

作者: ※潇洒※   发布时间: 2005-09-07

1、上面定义的xDOM都有哪些方法、属性?
比方说在我以上的例子中,如何得到所有项read_count值的合计?(假设不知道共有多少项,也不知道read_count在项中的位置)
2、access 数据用 ASP 等后台语言输出为 XML,是不是就像用asp从access输出为html那样?有没有一个对象可以将access中的数据直接输出成xml而不要专门的代码?

作者: s_x   发布时间: 2005-09-07