pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

<small id='wpbjz'></small><noframes id='wpbjz'>

      <legend id='wpbjz'><style id='wpbjz'><dir id='wpbjz'><q id='wpbjz'></q></dir></style></legend>
      • <bdo id='wpbjz'></bdo><ul id='wpbjz'></ul>
    1. <i id='wpbjz'><tr id='wpbjz'><dt id='wpbjz'><q id='wpbjz'><span id='wpbjz'><b id='wpbjz'><form id='wpbjz'><ins id='wpbjz'></ins><ul id='wpbjz'></ul><sub id='wpbjz'></sub></form><legend id='wpbjz'></legend><bdo id='wpbjz'><pre id='wpbjz'><center id='wpbjz'></center></pre></bdo></b><th id='wpbjz'></th></span></q></dt></tr></i><div class="nfffvd7" id='wpbjz'><tfoot id='wpbjz'></tfoot><dl id='wpbjz'><fieldset id='wpbjz'></fieldset></dl></div>
      <tfoot id='wpbjz'></tfoot>

      替代祖先或自我(或選擇樹中具有特定子節點的所

      alternative to ancestor-or-self ( or select all nodes in the tree with a specific child node)(替代祖先或自我(或選擇樹中具有特定子節點的所有節點))

      <small id='NQf9m'></small><noframes id='NQf9m'>

    2. <tfoot id='NQf9m'></tfoot>

            <legend id='NQf9m'><style id='NQf9m'><dir id='NQf9m'><q id='NQf9m'></q></dir></style></legend>

              • <bdo id='NQf9m'></bdo><ul id='NQf9m'></ul>
                  <tbody id='NQf9m'></tbody>

                <i id='NQf9m'><tr id='NQf9m'><dt id='NQf9m'><q id='NQf9m'><span id='NQf9m'><b id='NQf9m'><form id='NQf9m'><ins id='NQf9m'></ins><ul id='NQf9m'></ul><sub id='NQf9m'></sub></form><legend id='NQf9m'></legend><bdo id='NQf9m'><pre id='NQf9m'><center id='NQf9m'></center></pre></bdo></b><th id='NQf9m'></th></span></q></dt></tr></i><div class="5fvxnpf" id='NQf9m'><tfoot id='NQf9m'></tfoot><dl id='NQf9m'><fieldset id='NQf9m'></fieldset></dl></div>
                本文介紹了替代祖先或自我(或選擇樹中具有特定子節點的所有節點)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我正在嘗試識別樹中通向特定節點的所有節點.

                我正在嘗試通過 MSSQL XML (2005) 或 ASP 經典中的 Microsoft.XMLDOM 來實現這一點.

                我知道 XPATH 的邏輯,但 SQL Server 不支持 ancestor-or-self 軸,而且 XMLDOM 似乎在 :: 符號上窒息..

                當我在 XPATH 測試器中測試時有效的 xpath 是

                //static[@id=6]/ancestor-or-self::static

                我的 XML(在 sql server 中遞歸生成)看起來像

                <static id="1" title="some title 1"/><static id="2" title="一些標題 2"><兒童><static id="3" title="some title 3"/><static id="4" title="some title 4"><兒童><static id="5" title="some title 5"/><static id="6" title="some title 6"/></兒童></靜態></兒童></靜態><static id="7" title="some title 7"/></root>

                XPATH 應該以任何順序選擇 id 為 (2,4,6) 的節點,因此我可以為所有節點添加一個屬性..

                這是一個菜單系統,其中我只知道選定的葉子,并且需要將通向它的所有節點標記為 hilited..

                如果您能在克服 XMLDOM 阻塞方面得到任何幫助,我將不勝感激(運行 xml.documentElement.selectNodes("http://static[@id=6]/ancestor-or-self::static") 產生以下錯誤:Expected token 'eof' found ':'.//static[@id=6]/ancestor-or-self-->:<--:static)

                或者尋找替代解決方案.也許在任何深度找到包含特定節點(id = 6)的所有節點..

                解決方案

                在 W2K3 上運行,使用 IIS6 我測試了 MSXML2.XMLDomDocument.4.0 版本.

                Dim XMLDom ''# As MSXML2.DOMDocument40Set XMLDom = CreateObject("MSXML2.DOMDocument.4.0")調用 XMLDom.setProperty("SelectionLanguage", "XPath")調用 XMLDom.loadXML( {文檔如上所述 - 原始 xml 文檔中的錯誤))Dim originalQuery ''# As StringoriginalQuery = "http://static[@id=6]/ancestor-or-self::static"Dim replacementQuery ''# As StringreplaceQuery = "http://static[descendant::static[@id=6] or @id=6]"Dim XmlElemList ''# As MSXML2.IXMLDOMNodeList設置 XmlElemList = XMLDom.documentElement.selectNodes(originalQuery)Dim XmlElemList2 ''# As MSXML2.IXMLDOMNodeList設置 XmlElemList2 = XMLDom.documentElement.selectNodes(replacementQuery)Dim XmlElem ''# 作為 MSXML2.IXMLDOMElementCall Response.Write("Using original query : '" & originalQuery & "' (" & XmlElemList.Length & ")<br>")對于 XmlElemList 中的每個 XmlElem調用 Response.Write("XmlEntry : " & XmlElem.getAttribute("id") & "
                ")調用 Response.Write("****
                ")下一個Call Response.Write("使用替換查詢:'" & replacementQuery & "' (" & XmlElemList2.Length & ")<br>")對于 XmlElemList2 中的每個 XmlElem調用 Response.Write("XmlEntry : " & XmlElem.getAttribute("id") & "
                ")調用 Response.Write("****
                ")下一個

                I am trying to identify all the nodes in a tree that lead to a specific node.

                I am trying to accomplish this through either MSSQL XML (2005) or by the Microsoft.XMLDOM in ASP classic.

                I know the logic with XPATH but SQL Server does not support the ancestor-or-self axis and XMLDOM seems to choke on the :: notation..

                The xpath that works when i test it in XPATH testers is

                //static[@id=6]/ancestor-or-self::static
                

                my XML (generated recursively in sql server) looks like

                <root>
                  <static id="1" title="some title 1" />
                  <static id="2" title="some title 2">
                     <children>
                        <static id="3" title="some title 3" />
                        <static id="4" title="some title 4">
                          <children>
                            <static id="5" title="some title 5" />
                            <static id="6" title="some title 6" />
                          </children>
                        </static>
                     </children>
                  </static>
                  <static id="7" title="some title 7" />
                </root>
                

                the XPATH should select nodes with id (2,4,6) in any order, so i can add an attribute to all of them ..

                This is for a menu system, where i only know the selected leaf, and need to mark as hilited all the nodes leading to it..

                I would appreciate any assistance in either overcoming the XMLDOM choking (running xml.documentElement.selectNodes("http://static[@id=6]/ancestor-or-self::static") produces the following error: Expected token 'eof' found ':'. //static[@id=6]/ancestor-or-self-->:<--:static)

                or with finding an alternative solution. Maybe finding all nodes that contain the specific node (with id = 6 ) at any depth..

                解決方案

                Running on W2K3, using IIS6 i tested the MSXML2.XMLDomDocument.4.0 version.

                Dim XMLDom ''# As MSXML2.DOMDocument40
                
                Set XMLDom = CreateObject("MSXML2.DOMDocument.4.0")
                Call XMLDom.setProperty("SelectionLanguage", "XPath")
                
                Call XMLDom.loadXML( {document as described above - mistakes in original xml doc)
                )
                
                
                Dim originalQuery ''# As String
                originalQuery = "http://static[@id=6]/ancestor-or-self::static"
                
                Dim replacementQuery ''# As String
                replacementQuery = "http://static[descendant::static[@id=6] or @id=6]"
                
                
                Dim XmlElemList ''# As MSXML2.IXMLDOMNodeList
                Set XmlElemList = XMLDom.documentElement.selectNodes(originalQuery)
                
                Dim XmlElemList2 ''# As MSXML2.IXMLDOMNodeList
                Set XmlElemList2 = XMLDom.documentElement.selectNodes(replacementQuery)
                
                Dim XmlElem ''# As MSXML2.IXMLDOMElement
                Call Response.Write("Using original query : '" & originalQuery & "' (" & XmlElemList.Length & ")<br>")
                For Each XmlElem In XmlElemList
                    Call Response.Write("XmlEntry : " & XmlElem.getAttribute("id") & "<br>")
                    Call Response.Write("****<br>")
                Next
                
                Call Response.Write("Using replacement query : '" & replacementQuery & "' (" & XmlElemList2.Length & ")<br>")
                For Each XmlElem In XmlElemList2
                    Call Response.Write("XmlEntry : " & XmlElem.getAttribute("id") & "<br>")
                    Call Response.Write("****<br>")
                Next
                

                這篇關于替代祖先或自我(或選擇樹中具有特定子節點的所有節點)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Can I figure out a list of databases and the space used by SQL Server instances without writing SQL queries?(我可以在不編寫 SQL 查詢的情況下找出數據庫列表和 SQL Server 實例使用的空間嗎?) - IT屋-程序員軟件開發
                How to create a login to a SQL Server instance?(如何創建對 SQL Server 實例的登錄?)
                How to know the version and edition of SQL Server through registry search(如何通過注冊表搜索知道SQL Server的版本和版本)
                Why do I get a quot;data type conversion errorquot; with ExecuteNonQuery()?(為什么會出現“數據類型轉換錯誤?使用 ExecuteNonQuery()?)
                How to show an image from a DataGridView to a PictureBox?(如何將 DataGridView 中的圖像顯示到 PictureBox?)
                WinForms application design - moving documents from SQL Server to file storage(WinForms 應用程序設計——將文檔從 SQL Server 移動到文件存儲)

                1. <i id='4qA4g'><tr id='4qA4g'><dt id='4qA4g'><q id='4qA4g'><span id='4qA4g'><b id='4qA4g'><form id='4qA4g'><ins id='4qA4g'></ins><ul id='4qA4g'></ul><sub id='4qA4g'></sub></form><legend id='4qA4g'></legend><bdo id='4qA4g'><pre id='4qA4g'><center id='4qA4g'></center></pre></bdo></b><th id='4qA4g'></th></span></q></dt></tr></i><div class="dllbtrl" id='4qA4g'><tfoot id='4qA4g'></tfoot><dl id='4qA4g'><fieldset id='4qA4g'></fieldset></dl></div>
                2. <tfoot id='4qA4g'></tfoot>
                    <bdo id='4qA4g'></bdo><ul id='4qA4g'></ul>
                      <tbody id='4qA4g'></tbody>
                      • <small id='4qA4g'></small><noframes id='4qA4g'>

                          <legend id='4qA4g'><style id='4qA4g'><dir id='4qA4g'><q id='4qA4g'></q></dir></style></legend>
                          主站蜘蛛池模板: 证券新闻,热播美式保罗1984第二部_腾讯1080p-仁爱影院 | 安平县鑫川金属丝网制品有限公司,防风抑尘网,单峰防风抑尘,不锈钢防风抑尘网,铝板防风抑尘网,镀铝锌防风抑尘网 | 通风天窗,通风气楼,屋顶通风天窗,屋顶通风天窗公司 | 全国国际化学校_国际高中招生_一站式升学择校服务-国际学校网 | 北京企业宣传片拍摄_公司宣传片制作-广告短视频制作_北京宣传片拍摄公司 | 土壤养分检测仪|土壤水分|土壤紧实度测定仪|土壤墒情监测系统-土壤仪器网 | 数控走心机-走心机价格-双主轴走心机-宝宇百科 | 中山市派格家具有限公司【官网】 | bkzzy在职研究生网 - 在职研究生招生信息咨询平台 | 热镀锌槽钢|角钢|工字钢|圆钢|H型钢|扁钢|花纹板-天津千百顺钢铁贸易有限公司 | 大功率金属激光焊接机价格_不锈钢汽车配件|光纤自动激光焊接机设备-东莞市正信激光科技有限公司 定制奶茶纸杯_定制豆浆杯_广东纸杯厂_[绿保佳]一家专业生产纸杯碗的厂家 | 字典-新华字典-在线字典查字-字典趣 | 不锈钢轴流风机,不锈钢电机-许昌光维防爆电机有限公司(原许昌光维特种电机技术有限公司) | 压滤机滤板_厢式_隔膜_板框压滤机滤板厂家价格型号材质-大凯环保 | 偏心半球阀-电动偏心半球阀-调流调压阀-旋球阀-上欧阀门有限公司 | 重庆私家花园设计-别墅花园-庭院-景观设计-重庆彩木园林建设有限公司 | 刺绳_刀片刺网_刺丝滚笼_不锈钢刺绳生产厂家_安平县浩荣金属丝网制品有限公司-安平县浩荣金属丝网制品有限公司 | 水环真空泵厂家,2bv真空泵,2be真空泵-淄博真空设备厂 | 雷冲击高压发生器-水内冷直流高压发生器-串联谐振分压器-武汉特高压电力科技有限公司 | 杭州翻译公司_驾照翻译_专业人工翻译-杭州以琳翻译有限公司官网 组织研磨机-高通量组织研磨仪-实验室多样品组织研磨机-东方天净 | 保定市泰宏机械制造厂-河北铸件厂-铸造厂-铸件加工-河北大件加工 | 高速龙门架厂家_监控杆_多功能灯杆_信号灯杆_锂电池太阳能路灯-鑫世源照明 | 大型冰雕-景区冰雕展制作公司,3D创意设计源头厂家-[赛北冰雕] | 变色龙PPT-国内原创PPT模板交易平台 - PPT贰零 - 西安聚讯网络科技有限公司 | 三效蒸发器_多效蒸发器价格_四效三效蒸发器厂家-青岛康景辉 | 英语词典_成语词典_日语词典_法语词典_在线词典网 | 除湿机|工业除湿机|抽湿器|大型地下室车间仓库吊顶防爆除湿机|抽湿烘干房|新风除湿机|调温/降温除湿机|恒温恒湿机|加湿机-杭州川田电器有限公司 | 二手色谱仪器,十万分之一分析天平,蒸发光检测器,电位滴定仪-湖北捷岛科学仪器有限公司 | 皮带机_移动皮带机_大倾角皮带机_皮带机厂家 - 新乡市国盛机械设备有限公司 | LZ-373测厚仪-华瑞VOC气体检测仪-个人有毒气体检测仪-厂家-深圳市深博瑞仪器仪表有限公司 | 水平垂直燃烧试验仪-灼热丝试验仪-漏电起痕试验仪-针焰试验仪-塑料材料燃烧检测设备-IP防水试验机 | 广东教师资格网-广东教师资格证考试网 | 折弯机-刨槽机-数控折弯机-数控刨槽机-数控折弯机厂家-深圳豐科机械有限公司 | 超声波焊接机,振动摩擦焊接机,激光塑料焊接机,超声波焊接模具工装-德召尼克(常州)焊接科技有限公司 | EPK超声波测厚仪,德国EPK测厚仪维修-上海树信仪器仪表有限公司 | 岩石钻裂机-液压凿岩机-劈裂机-挖改钻_湖南烈岩科技有限公司 | 透平油真空滤油机-变压器油板框滤油机-滤油车-华之源过滤设备 | 安徽合肥项目申报咨询公司_安徽合肥高新企业项目申报_安徽省科技项目申报代理 | 沈阳建筑设计公司_加固改造设计_厂房设计_设计资质加盟【金辉设计】 | 电梯装饰-北京万达中意电梯装饰有限公司 | 带式压滤机_污泥压滤机_污泥脱水机_带式过滤机_带式压滤机厂家-河南恒磊环保设备有限公司 |