在下刚接触到这一方面,哪位大侠点通一下!感激不尽!!!

解决方案 »

  1.   

    参见http://www.jslab.org.cn源代码
      

  2.   

    可以通过xml文件对象和ajax两种方法来实现,ajax实现最可靠,几乎所有浏览器都可以支持,而用xml文件对象
    的方法只能在ie和firefox/mozilla浏览器下实现
    <!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" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <script type="text/javascript">
    function $(sId){
    return document.getElementById(sId);
    }function outputXml(oRoot){
    var aItems=oRoot.getElementsByTagName("*");
    var i,nLen=aItems.length;
    var oLi,oUl=$("ul1");

    for(i=0;i<nLen;i++){
    oLi=document.createElement("li");
    oLi.innerHTML=aItems[i].getAttribute("label");
    oUl.appendChild(oLi);
    }
    }function loadDate(){
    var rootNode;
    var xmlDoc=document.all
              ?new ActiveXObject('Msxml2.DOMDocument')
      :document.implementation.createDocument("", "", null);

    try{
    xmlDoc.async=false;
    xmlDoc.load('data.xml');
    rootNode=xmlDoc.documentElement;
    outputXml(rootNode);

    }catch(e){
    alert("发生错误:"+e);
    }
    }window.onload=function(){
    loadDate();
    }
    </script>
    </head>
    <body>
    <ul id="ul1">
    </ul>
    </body>
    </html>
      

  3.   

    <?xml version="1.0" encoding="utf-8"?>
    <items>
    <item id="i1" label="标题一"/>
    <item id="i2" label="标题二"/>
    <item id="i3" label="标题三"/>
    <item id="i4" label="标题四"/>
    <item id="i5" label="标题五"/>
    <item id="i6" label="标题六"/>
    </items>