阿木申 申楠

热衷编程技术 | 申楠 : qq:38371354 | msn:amushen2005@hotmail.com
posts - 44, comments - 51, trackbacks - 0, articles - 0

javascript中使用xpath的代码片断

Posted on 2004-09-01 11:38 阿木申 阅读(185) 评论(0) 编辑 收藏
var nodeList=null,path="";
xmlDoc=new ActiveXObject("microsoft.xmldom");
xmlDoc.async = false;
xmlDoc.load("filename.xml");
xmlDoc.setProperty("SelectionLanguage", "XPath");
path="//bm8kj_base[@property='1']";
nodeList = xmlDoc.documentElement.selectNodes(path);