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

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

    1. <tfoot id='sOdOK'></tfoot>

      1. <small id='sOdOK'></small><noframes id='sOdOK'>

        • <bdo id='sOdOK'></bdo><ul id='sOdOK'></ul>

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

        如何在 c# .net CF 3.5 中使用 XmlDocument 向 xml 添加屬

        How to add attributes to xml using XmlDocument in c# .net CF 3.5(如何在 c# .net CF 3.5 中使用 XmlDocument 向 xml 添加屬性)

            <tbody id='7zmEy'></tbody>
          • <small id='7zmEy'></small><noframes id='7zmEy'>

            <tfoot id='7zmEy'></tfoot>

              • <bdo id='7zmEy'></bdo><ul id='7zmEy'></ul>

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

                  本文介紹了如何在 c# .net CF 3.5 中使用 XmlDocument 向 xml 添加屬性的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我需要為元素aaa"創建一個帶有前綴xx"的屬性abc".以下代碼添加了前綴,但它也將 namespaceUri 添加到元素.

                  I need to create an attribute "abc" with the prefix "xx" for an element "aaa". The following code adds the prefix but it also adds the namespaceUri to the element.

                  所需輸出:

                  <mybody>
                  <aaa xx:abc="ddd"/>
                  <mybody/>
                  

                  我的代碼:

                    XmlNode node = doc.SelectSingleNode("http://mybody");
                    XmlElement ele = doc.CreateElement("aaa");
                  
                    XmlAttribute newAttribute = doc.CreateAttribute("xx","abc",namespace);              
                    newAttribute.Value = "ddd";
                  
                    ele.Attributes.Append(newAttribute);
                  
                    node.InsertBefore(ele, node.LastChild);
                  

                  以上代碼生成:

                  <mybody>
                  <aaa xx:abc="ddd" xmlns:xx="http://www.w3.org/1999/XSL/Transform"/>
                  <mybody/>
                  

                  想要的輸出是

                  <mybody>
                  <aaa xx:abc="ddd"/>
                  <mybody/>
                  

                  并且xx"屬性的聲明應該在根節點中完成,如:

                  And the declaration of the "xx" attribute should be done in the root node like :

                  <ns:somexml xx:xsi="http://www.w3.org/1999/XSL/Transform"  xmlns:ns="http://x.y.z.com/Protocol/v1.0">
                  

                  如果以 deisred 格式獲得輸出,如何獲得?如果 xml 不是這種所需的格式,則無法再對其進行處理..

                  How can if get the output in the deisred format? If the xml is not in this desired format then it cannot be processed anymore..

                  誰能幫忙?

                  謝謝,維姬

                  推薦答案

                  相信直接在根節點上設置相關屬性就可以了.這是一個示例程序:

                  I believe it's just a matter of setting the relevant attribute directly on the root node. Here's a sample program:

                  using System;
                  using System.Globalization;
                  using System.Xml;
                  
                  class Test
                  {
                      static void Main()
                      {
                          XmlDocument doc = new XmlDocument();
                          XmlElement root = doc.CreateElement("root");
                  
                          string ns = "http://sample/namespace";
                          XmlAttribute nsAttribute = doc.CreateAttribute("xmlns", "xx",
                              "http://www.w3.org/2000/xmlns/");
                          nsAttribute.Value = ns;
                          root.Attributes.Append(nsAttribute);
                  
                          doc.AppendChild(root);
                          XmlElement child = doc.CreateElement("child");
                          root.AppendChild(child);
                          XmlAttribute newAttribute = doc.CreateAttribute("xx","abc", ns);
                          newAttribute.Value = "ddd";        
                          child.Attributes.Append(newAttribute);
                  
                          doc.Save(Console.Out);
                      }
                  }
                  

                  輸出:

                  <?xml version="1.0" encoding="ibm850"?>
                  <root xmlns:xx="http://sample/namespace">
                    <child xx:abc="ddd" />
                  </root>
                  

                  這篇關于如何在 c# .net CF 3.5 中使用 XmlDocument 向 xml 添加屬性的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  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(從函數調用按鈕 OnClick)
                  <tfoot id='ccTCH'></tfoot>
                1. <small id='ccTCH'></small><noframes id='ccTCH'>

                  <legend id='ccTCH'><style id='ccTCH'><dir id='ccTCH'><q id='ccTCH'></q></dir></style></legend>
                    <tbody id='ccTCH'></tbody>
                      <bdo id='ccTCH'></bdo><ul id='ccTCH'></ul>

                          1. <i id='ccTCH'><tr id='ccTCH'><dt id='ccTCH'><q id='ccTCH'><span id='ccTCH'><b id='ccTCH'><form id='ccTCH'><ins id='ccTCH'></ins><ul id='ccTCH'></ul><sub id='ccTCH'></sub></form><legend id='ccTCH'></legend><bdo id='ccTCH'><pre id='ccTCH'><center id='ccTCH'></center></pre></bdo></b><th id='ccTCH'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ccTCH'><tfoot id='ccTCH'></tfoot><dl id='ccTCH'><fieldset id='ccTCH'></fieldset></dl></div>
                          2. 主站蜘蛛池模板: 午夜影院网站 | 成人小视频在线观看 | 久久精品亚洲精品国产欧美 | 91精品久久久久久久久久 | 午夜免费网 | 日本特黄a级高清免费大片 特黄色一级毛片 | 国产一级淫片免费视频 | 成人性生交大片免费看r链接 | 伊人伊人网 | 久久日韩精品一区二区三区 | 中文在线一区二区 | 久久麻豆精品 | 宅男噜噜噜66一区二区 | 免费观看一级特黄欧美大片 | av电影一区 | 精品国产欧美一区二区 | 国产精品久久久99 | av看片网站 | 综合色播| 欧美日韩精品久久久免费观看 | 天天操人人干 | 日韩免费高清视频 | 国产精品一区二区无线 | 成人在线黄色 | julia中文字幕久久一区二区 | 91视视频在线观看入口直接观看 | 黄色国产视频 | 日韩高清电影 | 国产在线精品免费 | 日韩欧美中文 | 少妇精品亚洲一区二区成人 | 国产精品18久久久久久白浆动漫 | 日韩在线精品强乱中文字幕 | 午夜a级理论片915影院 | 日韩视频区 | 久久久久久久久99精品 | 91性高湖久久久久久久久_久久99 | 一级在线毛片 | 亚洲精品日韩一区二区电影 | 久久久久久久久久久久久久av | 97色在线视频 |