久久久久久久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. 主站蜘蛛池模板: jlzzxxxx18hd护士 | 欧美色偷拍 | 久久99国产精一区二区三区 | 中文字幕亚洲视频 | 色小姐综合网 | 成人激情视频免费在线观看 | 精品国产欧美一区二区三区成人 | 日韩欧美一区二区三区四区 | 亚洲精品美女视频 | 毛片免费观看视频 | 国产精品国产 | 91视频官网 | 久久久av| 天天射天天干 | 成人免费在线观看 | 91精品国产91久久久久久 | 伊人网站在线观看 | 成人高清在线 | 日一区二区| 国产 欧美 日韩 一区 | 国产玖玖| 亚洲精品片 | 偷拍亚洲色图 | 欧美一级欧美三级在线观看 | 日本亚洲一区 | 精品在线看 | 性网址| 精品一区二区久久久久久久网站 | 欧美一级免费看 | 在线中文视频 | 亚洲视频 欧美视频 | 性高湖久久久久久久久 | 欧美日韩精品亚洲 | 日韩视频在线播放 | 成年人网站在线观看视频 | 欧美韩一区二区三区 | 久久国际精品 | 雨宫琴音一区二区在线 | 婷婷久久网| 黄片毛片 | 四虎影院在线观看免费视频 |