var xmldom = new ActiveXObject("Msxml2.DOMDocument")
xmldom.async = false
xmldom.load("c:\\xxx.xml")
alert(xmldom.xml)

解决方案 »

  1.   

    did you try it? I think access will be denied
      

  2.   

    用绑定吧,绑定好了比这个还要快,还要规整<xml id="test">
    <root>
    <news>
    <newstitle>今天</newstitle>
    <content>昨天昨天</content>
    </news>
    <news>
    <newstitle>今天</newstitle>
    <content>昨天昨天</content>
    </news>
    </root>
    </xml><table datasrc="#test">
    <tr>
    <td><div datafld="newstitle"></div></td>
    <td><div datafld="content"></div></td>
    </tr>
    </table>
      

  3.   

    这个不是读取,这个是数据绑定,用在显示的时候比较方便。只要用<xmlid="test"src="****.xml"></xml>替换,就可以找到你希望找的XML文档。