久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    1. <tfoot id='6EwNr'></tfoot>

        <bdo id='6EwNr'></bdo><ul id='6EwNr'></ul>
    2. <i id='6EwNr'><tr id='6EwNr'><dt id='6EwNr'><q id='6EwNr'><span id='6EwNr'><b id='6EwNr'><form id='6EwNr'><ins id='6EwNr'></ins><ul id='6EwNr'></ul><sub id='6EwNr'></sub></form><legend id='6EwNr'></legend><bdo id='6EwNr'><pre id='6EwNr'><center id='6EwNr'></center></pre></bdo></b><th id='6EwNr'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='6EwNr'><tfoot id='6EwNr'></tfoot><dl id='6EwNr'><fieldset id='6EwNr'></fieldset></dl></div>

      <small id='6EwNr'></small><noframes id='6EwNr'>

        <legend id='6EwNr'><style id='6EwNr'><dir id='6EwNr'><q id='6EwNr'></q></dir></style></legend>

        如何選擇使用默認(rèn)命名空間的節(jié)點?

        How do I select nodes that use a default namespace?(如何選擇使用默認(rèn)命名空間的節(jié)點?)
          <bdo id='7wxTW'></bdo><ul id='7wxTW'></ul>

              <legend id='7wxTW'><style id='7wxTW'><dir id='7wxTW'><q id='7wxTW'></q></dir></style></legend>

              <tfoot id='7wxTW'></tfoot>
                <i id='7wxTW'><tr id='7wxTW'><dt id='7wxTW'><q id='7wxTW'><span id='7wxTW'><b id='7wxTW'><form id='7wxTW'><ins id='7wxTW'></ins><ul id='7wxTW'></ul><sub id='7wxTW'></sub></form><legend id='7wxTW'></legend><bdo id='7wxTW'><pre id='7wxTW'><center id='7wxTW'></center></pre></bdo></b><th id='7wxTW'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='7wxTW'><tfoot id='7wxTW'></tfoot><dl id='7wxTW'><fieldset id='7wxTW'></fieldset></dl></div>
                  <tbody id='7wxTW'></tbody>

                <small id='7wxTW'></small><noframes id='7wxTW'>

                • 本文介紹了如何選擇使用默認(rèn)命名空間的節(jié)點?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時送ChatGPT賬號..

                  XML文件的結(jié)構(gòu)大致如下:

                  The structure of the XML file is more or less as follows:

                  <?xml version="1.0" encoding="UTF-8"?>
                  <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="url1" xsi:schemaLocation="url2 url3">
                     <b>
                       <c></c>
                       <c></c>
                       <c></c>
                     </b>
                  </a>
                  

                  我的目標(biāo)是選擇所有c"元素,但以下 xpath 表達(dá)式不起作用://a/b/c".

                  My goal is to select all the "c" elements, but the following xpath expression won't work: "http://a/b/c".

                  即:

                  XmlDocument doc= new XmlDocument();
                  doc.Load(filepath);
                  XmlNodeList l = doc.SelectNodes("http://a/b/c"); // 0 nodes
                  

                  我測試過的唯一有效的 xpath 表達(dá)式是/*(1 個節(jié)點)和//*(所有節(jié)點).

                  The only xpath expressions I tested that worked are /* (1 node) and //* (all nodes).

                  這個問題與 XML 命名空間有關(guān)嗎?如果是這樣,設(shè)置 XMLDocument 對象的正確方法是什么?

                  Is this problem related to the XML namespace? If so, what's the proper way to set up the XMLDocument object?

                          XmlDocument doc= new XmlDocument();
                          doc.Load(filepath);
                          XmlNamespaceManager m = new XmlNamespaceManager(doc.NameTable);
                          m.AddNamespace(/* what goes here? */);
                          XmlNodeList l = doc.SelectNodes("http://a/b/c", m);
                  

                  推薦答案

                  你需要為文檔使用的默認(rèn)命名空間分配一個命名空間前綴,然后在你的 XPath 中使用它:

                  You need to assign a namespace prefix for the default namespace that the document is using, and then use that in your XPath:

                  XmlDocument doc= new XmlDocument();
                  doc.Load(filepath);
                  
                  XmlNamespaceManager m = new XmlNamespaceManager(doc.NameTable);
                  m.AddNamespace("myns", "url1");
                  
                  XmlNodeList l = doc.SelectNodes("/myns:a/myns:b/myns:c", m);
                  

                  您可以將前綴myns"替換為基本上任何內(nèi)容(不帶空格的字母數(shù)字),只要它在第 4 行和 XPath 之間保持一致,并且正確分配給第 4 行中的url1"命名空間.

                  You can replace the prefix "myns" with essentially anything (alphanumeric without spaces), as long as it's consistent between line 4 and the XPath, and that it's correctly assigned to the "url1" namespace in line 4.

                  這篇關(guān)于如何選擇使用默認(rèn)命名空間的節(jié)點?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  What are good algorithms for vehicle license plate detection?(車牌檢測有哪些好的算法?)
                  onClick event for Image in Unity(Unity中圖像的onClick事件)
                  Running Total C#(運行總 C#)
                  Deleting a directory when clicked on a hyperlink with JAvascript.ASP.NET C#(單擊帶有 JAvascript.ASP.NET C# 的超鏈接時刪除目錄)
                  asp.net listview highlight row on click(asp.net listview 在單擊時突出顯示行)
                  Calling A Button OnClick from a function(從函數(shù)調(diào)用按鈕 OnClick)
                      <tfoot id='X1Ugv'></tfoot>

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

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

                              <tbody id='X1Ugv'></tbody>
                            主站蜘蛛池模板: 激情av | 中文字字幕一区二区三区四区五区 | 国产一区 | 国产精品久久久久久久久久妞妞 | 国产中文区二幕区2012 | 国产欧美日韩综合精品一区二区 | 不卡的av在线 | 91av视频在线观看 | 中文字幕精品视频 | 国产福利在线 | 国产精品99久久免费观看 | 在线播放国产一区二区三区 | 日本精品久久 | 日韩精品一区在线 | 欧美xxxx做受欧美 | 嫩草视频在线 | 成人在线免费视频 | 一区二区日韩 | 一级片网址 | 久久国产传媒 | 日韩精品在线看 | 精品久久久久久久久久久久久久 | 日韩高清中文字幕 | 91久久久久| 欧美国产日韩精品 | 亚洲五码久久 | 91av视频在线 | 一区二区三区视频在线观看 | 香蕉久久a毛片 | 欧美二区三区 | www.嫩草| 91性高湖久久久久久久久_久久99 | 亚洲视频一区在线观看 | 中文字幕第5页 | 日韩电影中文字幕 | 精品久久国产 | 亚洲欧美日韩一区二区 | 精精国产xxxx视频在线播放 | 久久久国产一区二区三区四区小说 | 天天操天天射天天舔 | 国产ts人妖另类 |