html读取xml的问题

jizq_wf 2007-12-03 10:32:09
现在可以利用一个html读取xml的文件。但是我想把html里面的table换成div+css实现,请问如何操作,下面是html的代码:
html>   
<head> <title> book1.xml display </title> </head>
<body> <xml id="dso1" src="book1.xml"> </xml>
<h3> book1 document content </h3>
<table datasrc="#dso1" border="1">
<thead> <th>title</th> <th>author</th> <th>price</th>
</thead>
<tr><td><span datafld="title"></span></td>
<td><span datafld="author"></span></td>
<td><span datafld="price"></span></td>

</tr>
</table>
<table datasrc="#dso1" border="2">
<thead><th>title</th><th>author</th><th>price</th></thead>
<tr><td><span datafld="title"></span></td>
<td><span datafld="author"></span></td>
<td><span datafld="price"></span></td></tr>
</table>
</body>
</html>


下面是:book1.xml的代码
<?xml version="1.0"?>
<!DOCTYPE books [
<!ELEMENT books (book)*>
<!ELEMENT book (title, author, price)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT price (#PCDATA)>
]>
<books>
<book>
<title>bname1</title>
<author>aname1</author>
<price>$100</price>
</book>
<book>
<title>bname2</title>
<author>aname2</author>
<price>$200</price>
</book>
<book>
<title>bname2</title>
<author>aname2</author>
<price>$200</price>
</book>
<book>
<title>bname2</title>
<author>aname2</author>
<price>$23453400</price>
</book>
<book>
<title>bname2</title>
<author>aname2</author>
<price>$200</price>
</book>
<book>
<title>bname1</title>
<author>aname1</author>
<price>$1dfdfs00</price>
</book>
<book>
<title>bname2</title>
<author>aname2</author>
<price>$200</price>
</book>
<book>
<title>bname2</title>
<author>aname2</author>
<price>$200</price>
</book>
<book>
<title>bname2</title>
<author>aname2</author>
<price>$200</price>
</book>
<book>
<title>bname2</title>
<author>aname2</author>
<price>$200</price>
</book>
<book>
<title>bname2</title>
<author>aname2</author>
<price>$200</price>
</book>
<book>
<title>bname2</title>
<author>aname2</author>
<price>$200</price>
</book>
<book>
<title>bname1</title>
<author>aname1</author>
<price>$1dfdfs00</price>
</book>
<book>
<title>bname2</title>
<author>aname2</author>
<price>$200</price>
</book>
<book>
<title>bname2</title>
<author>aname2</author>
<price>$200</price>
</book>
<book>
<title>bname2</title>
<author>aname2</author>
<price>$200</price>
</book>
<book>
<title>bname2</title>
<author>aname2</author>
<price>$200</price>
</book><book>
<title>bname2</title>
<author>aname2</author>
<price>$200</price>
</book>
<book>
<title>bname2</title>
<author>aname2</author>
<price>$200</price>
</book>
<book>
<title>bname1</title>
<author>aname1</author>
<price>$1dfdfs00</price>
</book>
<book>
<title>bname2</title>
<author>aname2</author>
<price>$200</price>
</book>
<book>
<title>bname2</title>
<author>aname2</author>
<price>$200</price>
</book>
<book>
<title>bname2</title>
<author>aname2</author>
<price>$200</price>
</book>
<book>
<title>bname2</title>
<author>aname2</author>
<price>$200</price>
</book>
</books>
...全文
391 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
fcuandy 2007-12-10
  • 打赏
  • 举报
回复
用div+css的话,就不建议使用数据岛,而是采用xslt格式化输出.
windykuang 2007-12-10
  • 打赏
  • 举报
回复
DIV+CSS在被搜索引擎搜录上有优势
my_web 2007-12-05
  • 打赏
  • 举报
回复
不用table
多接点不是很好实现
cds27 2007-12-05
  • 打赏
  • 举报
回复
提高的话就不要用数据岛了。
感觉这东西很不透明,连运作的机制都让人搞不懂,在帮助方面似乎也做的不够。
这东西用起来束手束脚的,难用。
bingdian37 2007-12-03
  • 打赏
  • 举报
回复
div加css有啥好的?

不要勉强,不要崇拜,适则用不适则废
jizq_wf 2007-12-03
  • 打赏
  • 举报
回复
哈哈。是这样。但是对于我的提高还是有益的。所以。。。

8,906

社区成员

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

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