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

    • <bdo id='fYpgs'></bdo><ul id='fYpgs'></ul>
    <tfoot id='fYpgs'></tfoot>

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

        <i id='fYpgs'><tr id='fYpgs'><dt id='fYpgs'><q id='fYpgs'><span id='fYpgs'><b id='fYpgs'><form id='fYpgs'><ins id='fYpgs'></ins><ul id='fYpgs'></ul><sub id='fYpgs'></sub></form><legend id='fYpgs'></legend><bdo id='fYpgs'><pre id='fYpgs'><center id='fYpgs'></center></pre></bdo></b><th id='fYpgs'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='fYpgs'><tfoot id='fYpgs'></tfoot><dl id='fYpgs'><fieldset id='fYpgs'></fieldset></dl></div>
        <legend id='fYpgs'><style id='fYpgs'><dir id='fYpgs'><q id='fYpgs'></q></dir></style></legend>
      2. 驗證 xml 節點,而不是整個文檔

        Validating xml nodes, not the entire document(驗證 xml 節點,而不是整個文檔)

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

            <bdo id='Yp090'></bdo><ul id='Yp090'></ul>

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

              1. <i id='Yp090'><tr id='Yp090'><dt id='Yp090'><q id='Yp090'><span id='Yp090'><b id='Yp090'><form id='Yp090'><ins id='Yp090'></ins><ul id='Yp090'></ul><sub id='Yp090'></sub></form><legend id='Yp090'></legend><bdo id='Yp090'><pre id='Yp090'><center id='Yp090'></center></pre></bdo></b><th id='Yp090'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Yp090'><tfoot id='Yp090'></tfoot><dl id='Yp090'><fieldset id='Yp090'></fieldset></dl></div>
                  <tbody id='Yp090'></tbody>
                  <tfoot id='Yp090'></tfoot>
                • 本文介紹了驗證 xml 節點,而不是整個文檔的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在使用一些在 xml 中形成元素的 xml 'snippets'.我有架構,但我無法驗證這些文件,因為它們不是完整的 xml 文檔.這些片段包含必要的父元素以在其他工具中使用它們時形成有效的 xml,因此我沒有太多選擇將它們變成有效的 xml 或更改架構.

                  I'm working with some xml 'snippets' that form elements down the xml. I have the schema but I cannot validate these files because they are not complete xml documents. These snippets are wrapped with the necessary parent elements to form valid xml when they are used in other tools so I don't have much option in making them into valid xml or in changing the schema.

                  是否可以驗證一個元素,而不是整個文檔?如果沒有,可以建議哪些解決方法?

                  Is it possible to validate an element, rather than the whole document? If not, what workarounds could be suggested?

                  我正在使用帶有 .NET 2.0 框架的 C#.

                  I'm working in C# with .NET 2.0 framework.

                  推薦答案

                  我遇到了類似的問題,我只能驗證部分 XML 文檔.我在這里想出了這個方法:

                  I had a similar problem where I could only validate parts of my XML document. I came up with this method here:

                  private void ValidateSubnode(XmlNode node, XmlSchema schema)
                  {
                      XmlTextReader reader = new XmlTextReader(node.OuterXml, XmlNodeType.Element, null);
                  
                      XmlReaderSettings settings = new XmlReaderSettings();
                      settings.ConformanceLevel = ConformanceLevel.Fragment;
                      settings.Schemas.Add(schema);
                      settings.ValidationType = ValidationType.Schema;
                      settings.ValidationEventHandler += new ValidationEventHandler(XSDValidationEventHandler);
                  
                      using (XmlReader validationReader = XmlReader.Create(reader, settings))
                      {     
                          while (validationReader.Read())
                          {
                          }
                      }
                  }
                  
                  private void XSDValidationEventHandler(object sender, ValidationEventArgs args)
                  {
                      errors.AppendFormat("XSD - Severity {0} - {1}", 
                                          args.Severity.ToString(), args.Message);
                  }
                  

                  基本上,我將一個 XmlNode(我通過 .SelectSingleNode 從整個 XmlDocument 中選擇)和一個?? XML 模式傳遞給它,我從我的應用程序內的嵌入式資源 XSD 加載它.任何可能發生的驗證錯誤都被填充到錯誤"字符串構建器中,然后我在最后讀出它,看看是否記錄了任何錯誤.

                  Basically, I pass it an XmlNode (which I select from the entire XmlDocument by means of .SelectSingleNode), and an XML schema which I load from an embedded resource XSD inside my app. Any validation errors that might occur are being stuffed into a "errors" string builder, which I then read out at the end, to see if there were any errors recorded, or not.

                  為我工作 - 你的里程可能會有所不同:-)

                  Works for me - your mileage may vary :-)

                  這篇關于驗證 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)

                    <bdo id='IqiuU'></bdo><ul id='IqiuU'></ul>

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

                          <tbody id='IqiuU'></tbody>

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

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

                            主站蜘蛛池模板: 久久久久久久久国产 | 亚洲午夜精品久久久久久app | 精品一区二区三区四区五区 | 欧美在线一区视频 | 天天干夜夜操视频 | 国产一级网站 | 青青草社区 | 精品一区精品二区 | 极品电影院 | 欧美又大粗又爽又黄大片视频 | 伊人免费网 | 四虎影音 | 欧洲免费视频 | 中文字幕 在线观看 | 日韩成人在线网址 | 美女国内精品自产拍在线播放 | 久久一区二| 色视频免费 | 亚洲人a| 日本在线免费 | 一区二区三区四区在线免费观看 | 成人精品网| 成人一区二区三区在线观看 | 日本电影免费完整观看 | 手机看黄av免费网址 | 亚洲精品视频免费看 | 成人做爰69片免费观看 | 亚洲一区二区三区免费视频 | 免费一区二区 | 色av一区二区三区 | 伊人伊成久久人综合网站 | 中文字幕在线一区二区三区 | 国产午夜精品一区二区三区嫩草 | www.一区二区三区 | 性高湖久久久久久久久aaaaa | 国产精品中文字幕在线播放 | 国产精品一区二区三区四区 | 超碰97人人人人人蜜桃 | 在线中文视频 | 欧美日韩在线不卡 | 久久久久午夜 |