<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns="
http://www.w3.org/1999/xhtml";>
<head>
<meta http-equiv="Content-Type" c />
<!-- Author:hongjuesir@gmail.com Share happily !-->
<title>DSO示例</title>
</head>
<script language="javascript">
var xmlDoc;
function loadXml2Dso()
{
xmlDoc = ClassData.XMLDocument;
xmlDoc.load("ClassData.xml");
}
function moveDso()
{
var theSet = ClassData.recordset;
theSet.moveNext();
/**//*· movePrevious(): 指向前一个数据项。
· moveFirst(): 指向第一个数据项。
· moveLast(): 指向最后一个数据项。
· EOF: 这个属性用来检测我们是否已经到达数据记录的底部。*/
}
</script>
<XML id="stuData" src="DsoData.xml"></XML>
<object id="ClassData" CLASSID="clsid:550dda30-0541-11d2-9ca9-0060b0ec3d39"
width="0" height="0"></object>
<body>
<table width="80%" datasrc="#stuData" border="1" cellspacing="0" cellpadding="0">
<caption>
学生数据
</caption>
<thead>
<tr>
<th scope="col">姓名</th>
<th scope="col">年龄</th>
<th scope="col">班级</th>
</tr>
</thead>
<tbody>
<tr>
<td><span datafld="name"></span></td>
<td><span datafld="age"></span></td>
<td><span datafld="class"></span></td>
</tr>
</tbody>
</table>
<p>
<label>获取班级xml到Dso并绑定到table
<input type="submit" name="Submit" value="获取" />
</label>
</p>
<table datasrc="#ClassData" border="1">
<tr>
<td><input type="text" datafld="id" /></td>
<td><span datafld="name"></span></td>
</tr>
</table>
<p>
<label>移动DSO的RecordSet
<input type="submit" name="Submit" value="移动" />
</label>
</p>
<div>
<span datasrc="#ClassData" datafld="id" style="margin-right:20px; background-color:#0099FF"></span>
<span datasrc="#ClassData" datafld="name" style="background-color:#99CC00"></span>
</div>
</body>
</html>