Html读取Xml

代码
<html>
<head>
<title> 数据岛的显示 </title>
</head>
<body>
<xml id="stu" src="user.xml"></xml>
<h2>学生信息管理</h2>
<table DATASRC="#stu" border="1" DATAPAGESIZE=5>
<thead>
<th>学号</th>
<th>姓名</th>
</thead>
<tbody>
<tr>
<td>
<div DATAFLD="name"></div>
</td>
<td>
<div DATAFLD="age"></div>
</td>
</tr>
</tbody>
</table>
</body>
</html>

 

代码
<?xml version="1.0" encoding="utf-8" ?>
- <students>
- <student>
<name>java</name>
<age>21</age>
</student>
- <student>
<name>jiang</name>
<age>22</age>
</student>
- <student>
<name>001</name>
<age>23</age>
</student>
- <student>
<name>yang</name>
<age>24</age>
</student>
- <student>
<name>002</name>
<age>25</age>
</student>
</students>

 

posted @ 2010-12-06 21:15  TerryChou  阅读(447)  评论(0编辑  收藏  举报