午夜国产狂喷潮在线观看|国产AⅤ精品一区二区久久|中文字幕AV中文字幕|国产看片高清在线

    hta實(shí)現(xiàn)的笨狼樹狀節(jié)點(diǎn)查看器
    來源:易賢網(wǎng) 閱讀:889 次 日期:2014-08-12 17:48:36
    溫馨提示:易賢網(wǎng)小編為您整理了“hta實(shí)現(xiàn)的笨狼樹狀節(jié)點(diǎn)查看器”,方便廣大網(wǎng)友查閱!

    <html>

    <head>

    <style>

    table

    {

        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;

        font-size:12;

        cursor:hand;

    }

    </style>

    <title>笨狼樹狀節(jié)點(diǎn)查看器</title>

    </head>

    <body>

     <INPUT type="file" id=file1 name=file1>請(qǐng)輸入xml文件路徑

     <INPUT type="button" value="確定" onclick = "vbs:analyse ">

     <SELECT id="select1" onchange="vbs:analyse">

            <OPTION value="nodeName" >顯示標(biāo)簽</OPTION>

            <OPTION  value="text" >顯示文字</OPTION>

            <OPTION  value="attribute" >顯示屬性</OPTION>

            <OPTION  value="XPath" >顯示XPath</OPTION>

    </SELECT>

    <DIV id="oList" style="padding-left:0"></DIV>

    </body>

     <script language="vbScript" >

        '**************************************

        '****作者:    超級(jí)大笨狼 superdullwolf****

        '**************************************        

            public dic,favour,anything    ,doc      

            set doc = CreateObject("Microsoft.XMLDOM")        

            doc.async=False

        sub analyse()

                dim myTR 

                favour = select1.value

                removeDIV  

                if not doc.load(file1.value) then 

                    alert "文件加載失敗,請(qǐng)檢查文件是否存在!"    

                else

                    Set rootNode = doc.DocumentElement

                    set rootDIV = document.createElement("DIV")    

                    rootDIV.setAttribute "XPath",rootNode.nodeName 

                    oList.setAttribute "XPath",rootNode.nodeName                  

                    oList.setAttribute "parsed",false

                    appendDIV     oList,rootNode    

                end if

        end sub

        sub appendDIV(myDIV,myNode)    

            dim myChild    ,newDIV,ChildID,thisID ,ChildXPath

            

            for each myChild in myNode.childNodes

                if     myChild.nodeName <> "#text"    then    

                    set newDIV = document.createElement("DIV")            

                    myDIV.appendChild    newDIV            

                    addPx newDIV, myDIV,10    '縮進(jìn)10象素

                    ChildID = 0

                    ChildXPath = myDIV.getAttribute("XPath") & "/" & myChild.nodeName & "[" & ChildID & "]"    

                    do while not doc.selectSingleNode(ChildXPath) is myChild

                        ChildID=ChildID+1

                        ChildXPath = myDIV.getAttribute("XPath") & "/" & myChild.nodeName & "[" & ChildID & "]"    

                    loop

                    newDIV.setAttribute "XPath",ChildXPath 

                    newDIV.setAttribute "parsed",false    '子元素還沒標(biāo)記過了。

                    newDIV.title = newDIV.getAttribute("XPath") 

                    newDIV.innerText = getText(myChild,newDIV) 

                    if myChild.childNodes.length>0 then 

                            newDIV.attachEvent "onclick",GetRef("attachOnclick")

                    end if

                end if                     

            next

            myDIV.setAttribute "parsed",true'所有子元素都標(biāo)記過了。

        end sub    

        sub removeDIV()             

            dim oldDIV

            for each  oldDIV in   oList.childNodes          

                   oldDIV.removeNode(true)             

             next     

        end sub

        sub attachOnclick()

            dim obj    ,nodeXPath,cDIV

            set obj=window.event.srcElement 

            nodeXPath = obj.getAttribute("XPath")

            if instr(nodeXPath,"#text") >0 then 

                window.event.cancelBubble = true

                exit sub

            end if

            if not obj.getAttribute("parsed")= true then     

                 appendDIV obj ,doc.selectSingleNode(nodeXPath)

            else

                for each cDIV in obj.children

                    if cDIV.style.display = "none" then

                        cDIV.style.display = ""

                    else

                        cDIV.style.display = "none"

                    end if

                next

            end if

            window.event.cancelBubble = true         

        end sub

        function getText(myNode,oDIV)

            dim myAttribute

            getText = ""

            select case favour

                case "text"

                    if not isnull(myNode.text) then

                        getText = myNode.text

                     else

                        getText = "空文字"

                     end if            

                case "nodeName"                 

                        getText = myNode.nodeName    

                case "attribute"    

                    if myNode.nodeName <>"#text" then

                        for each myAttribute in  myNode.attributes                         

                            getText =getText &  myAttribute.name

                            getText = getText & "=" & chr(34) 

                            getText = getText & myAttribute.value  & chr(34) & " "

                        next

                        getText = trim(getText)

                    end if

                 

                case "XPath"

                    getText = oDIV.title

            end select

            if trim(getText) ="" then getText ="空"

        end function

        sub addPx(newDIV,oldDIV,num)

            dim re,myString    

            set re = new RegExp

            re.Global = true

            re.Pattern = "[^\d]*"            

            myString =  re.Replace(oldDIV.style.paddingLeft, "")

            if myString ="" then myString = "0"

            myString = (cint(myString) + num ) & "px"

            newDIV.style.paddingLeft = myString

            set re = nothing

        end sub

     </script>

    </html>

    更多信息請(qǐng)查看IT技術(shù)專欄

    更多信息請(qǐng)查看腳本欄目
    易賢網(wǎng)手機(jī)網(wǎng)站地址:hta實(shí)現(xiàn)的笨狼樹狀節(jié)點(diǎn)查看器
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

    2025國(guó)考·省考課程試聽報(bào)名

    • 報(bào)班類型
    • 姓名
    • 手機(jī)號(hào)
    • 驗(yàn)證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡(jiǎn)要咨詢 | 簡(jiǎn)要咨詢須知 | 新媒體/短視頻平臺(tái) | 手機(jī)站點(diǎn) | 投訴建議
    工業(yè)和信息化部備案號(hào):滇ICP備2023014141號(hào)-1 云南省教育廳備案號(hào):云教ICP備0901021 滇公網(wǎng)安備53010202001879號(hào) 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號(hào)
    云南網(wǎng)警備案專用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號(hào):hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報(bào)警專用圖標(biāo)