资源描述:
《hta实现的笨狼树状节点查看器_》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、hta实现的笨狼树状节点查看器_htmlheadstyletable{border-collapse:collapse;border-width:4;border-style:double;border-color:#15336f;font-size:12px;}body{font-size:12px;}div{width:100%;height:9;border-style:solid;border-width:1;border-color:#eeeeee;vertical-align:top;f
2、ont-size:12;cursor:hand;}/styletitle笨狼树状节点查看器/title/headbodyinputtype=fileid=file1name=file1请输入xml文件路径inputtype=buttonvalue=确定onclick=vbs:analyseselectid=select1onchange=vbs:analyseoptionvalue=nodename显示标签/optionoptionvalue=text显示文字/optionoptionvalue=a
3、ttribute显示属性/optionoptionvalue=xpath显示xpath/option/selectdivid=oliststyle=padding-left:0/div/bodyscriptlanguage=vbscript'**************************************'****:超级大笨狼superdullwolf****'**************************************publicdic,favour,anything,
4、docsetdoc=createobject(microsoft.xmldom)doc.async=falsesubanalyse()dimmytrfavour=select1.valueremovedivifnotdoc.load(file1.value)thenalert文件加载失败,请检查文件是否存在!elsesetrootnode=doc.documentelementsetrootdiv=document.createelement(div)rootdiv.setattributexpat
5、h,rootnode.nodenameolist.setattributexpath,rootnode.nodenameolist.setattributeparsed,falseappenddivolist,rootnodeendifendsubsubappenddiv(mydiv,mynode)dimmychild,newdiv,childid,thisid,childxpathforeachmychildinmynode.childnodesifmychild.nodename#textthe
6、nsetnewdiv=document.createelement(div)mydiv.appendchildnewdivaddpxnewdiv,mydiv,10'缩进10象素childid=0childxpath=mydiv.getattribute(xpath)/mychild.nodename[childid]dowhilenotdoc.selectsinglenode(childxpath)ismychildchildid=childid+1childxpath=mydiv.getattri
7、bute(xpath)/mychild.nodename[childid]loopnewdiv.setattributexpath,childxpathnewdiv.setattributeparsed,false'子元素还没标记过了。newdiv.title=newdiv.getattribute(xpath)newdiv.innertext=gettext(mychild,newdiv)ifmychild.childnodes.length0thennewdiv.attacheventoncli
8、ck,getref(attachonclick)endifendifnextmydiv.setattributeparsed,true'全部子元素都标记过了。endsubsubremovediv()dimolddivforeacholddivinolist.childnodesolddiv.removenode(true)nextendsubsubattachonclick()dimobj,nodexpath,cdivsetobj=window.event.srcel