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

  • <small id='01Y58'></small><noframes id='01Y58'>

  • <tfoot id='01Y58'></tfoot>

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

        <bdo id='01Y58'></bdo><ul id='01Y58'></ul>
    1. <legend id='01Y58'><style id='01Y58'><dir id='01Y58'><q id='01Y58'></q></dir></style></legend>

      1. 在 C# 中使用命名空間創(chuàng)建特定的 XML 文檔

        Creating a specific XML document using namespaces in C#(在 C# 中使用命名空間創(chuàng)建特定的 XML 文檔)
          <bdo id='CwlEo'></bdo><ul id='CwlEo'></ul>
            <tbody id='CwlEo'></tbody>

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

        • <tfoot id='CwlEo'></tfoot>

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

                  本文介紹了在 C# 中使用命名空間創(chuàng)建特定的 XML 文檔的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  我們獲得了一個(gè)示例文檔,并且需要能夠準(zhǔn)確地為供應(yīng)商重現(xiàn)文檔的結(jié)構(gòu).但是,我對(duì) C# 如何處理命名空間有點(diǎn)迷茫.以下是文檔示例:

                  We were given a sample document, and need to be able to reproduce the structure of the document exactly for a vendor. However, I'm a little lost with how C# handles namespaces. Here's a sample of the document:

                  <?xml version="1.0" encoding="UTF-8"?>
                  <Doc1 xmlns="http://www.sample.com/file" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="http://www.sample.com/file/long/path.xsd">
                      <header>
                          <stuff>data</stuff>
                          <morestuff>data</morestuff>
                      </header>
                   </Doc1>
                  

                  我通常會(huì)加載一個(gè)空白文檔,然后開始填充它:

                  How I'd usually go about this is to load a blank document, and then start populating it:

                  XmlDocument doc = new XmlDocument();
                  doc.LoadXml("<Doc1></Doc1>");
                  // Add nodes here with insert, etc...
                  

                  一旦開始創(chuàng)建文檔,如何將命名空間和架構(gòu)放入 Doc1 元素中?如果我從 Doc1 元素中的命名空間和模式開始,將它們包含在 LoadXml() 中,那么 所有 子元素上都有命名空間——這是一個(gè)禁忌.文檔被拒絕.

                  Once I get the document started, how do I get the namespace and schema into the Doc1 element? If I start with the namespace and schema in the Doc1 element by including them in the LoadXml(), then all of the child elements have the namespace on them -- and that's a no-no. The document is rejected.

                  因此,換句話說,我必須完全按照所示制作它.(而且我寧愿不只是在 C# 中編寫文本到文件并希望它是有效的 XML).

                  So in other words, I have to produce it EXACTLY as shown. (And I'd rather not just write text-to-a-file in C# and hope it's valid XML).

                  推薦答案

                  你應(yīng)該這樣試試

                    XmlDocument doc = new XmlDocument();  
                  
                    XmlSchema schema = new XmlSchema();
                    schema.Namespaces.Add("xmlns", "http://www.sample.com/file");
                  
                    doc.Schemas.Add(schema);
                  

                  不要忘記包含以下命名空間:

                  Do not forget to include the following namespaces:

                  using System.Xml.Schema;
                  using System.Xml;
                  

                  這篇關(guān)于在 C# 中使用命名空間創(chuàng)建特定的 XML 文檔的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

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

                        <tbody id='h5eNB'></tbody>
                        <bdo id='h5eNB'></bdo><ul id='h5eNB'></ul>
                        <tfoot id='h5eNB'></tfoot>

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

                          • <small id='h5eNB'></small><noframes id='h5eNB'>

                            <legend id='h5eNB'><style id='h5eNB'><dir id='h5eNB'><q id='h5eNB'></q></dir></style></legend>
                            主站蜘蛛池模板: 中文字幕在线观看视频一区 | 欧美日韩亚洲一区 | 高清免费av| 欧美性生活免费 | 一区二区三区电影网 | 天天色天天色 | 成人在线小视频 | 精品免费在线 | 国产午夜精品一区二区三区 | 欧美激情一区二区 | 国产精品一区二 | 成人在线播放网站 | 亚洲精品二区 | 视频一二区 | 久久久久久久久久久成人 | 久久国产成人 | 噜啊噜在线| 日日爱视频 | 亚洲国产精品一区 | 亚洲一区二区三区福利 | 国产精品久久久久久中文字 | 做a的各种视频 | 国产精品网址 | 新超碰97 | 99re国产 | 韩日一区二区 | 91n成人| 在线播放第一页 | 国产精品一区二区免费看 | 久在线观看 | 国产精品a免费一区久久电影 | 天天综合天天 | 国产精品欧美精品 | 亚洲免费在线视频 | 日批日韩在线观看 | 国产精品免费看 | 黄色在线观看 | 日韩在线播放第一页 | 青青草国产在线观看 | 99精品一区二区 | 国产剧情一区 |