<script>
function readxml(){
var xmldoc=dbck.XMLDocument;
var node=xmldoc.selectSingleNode('//VehicleList');
var subnodes=node.childNodes;
var objSel=document.all.TestSelect;
for(var i=0;i<subnodes.length;i++){
var subnode=subnodes(i);
var o=document.createElement("option");
o.text=subnode.childNodes(1).text;
o.value=subnode.childNodes(0).text;
objSel.add(o);
}
}
</script>
<body onload=readxml()>
<xml ID="dbck">
  <VehicleList>
    <Vehicle>
       <vID>1</vID>
<DriverID>A</DriverID>
    </Vehicle>
    <Vehicle>
       <vID>2</vID>
<DriverID>B</DriverID>
    </Vehicle>
    <Vehicle>
<vID>3</vID>
<DriverID>C</DriverID>
    </Vehicle>
  </VehicleList>
</xml>
<table width="100%" height="135" border="0">
  <tr>
    <td width="14%">&nbsp;</td>
    <td width="86%">
      <select name="TestSelect">
      </select>
    </td>
  </tr>
</table>
</body>

解决方案 »

  1.   

    select的绑定,只是将select原有数据与数据源第一个节点值相等的option 的selected设为true
    要想实现数据添加,用DOM例如: 
    <body>
    <xml ID="dbck">
      <VehicleList>
        <Vehicle>
          <vID>1</vID>
    <DriverID>A</DriverID>
        </Vehicle>
        <Vehicle>
          <vID>2</vID>
    <DriverID>B</DriverID>
        </Vehicle>
        <Vehicle>
    <vID>3</vID>
    <DriverID>C</DriverID>
        </Vehicle>
      </VehicleList>
    </xml>
    <table width="100%" height="135" border="0">
      <tr>
        <td width="14%">&nbsp;</td>
        <td width="86%">
      <select name="TestSelect" id="TestSelect" DATASRC="#dbck"  DATAFLD="DriverID">
    <option value="C">C</option>
            <option value="A">A</option>
            <option value="B">B</option>
          </select></td>
      </tr>
    </table>
    </body>
      

  2.   

    以上都是通过解析XML得到加载。和邦定有区别,可能不能绑定。不过非常感谢各位
    现在结帖。