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

<small id='8Gpmr'></small><noframes id='8Gpmr'>

<legend id='8Gpmr'><style id='8Gpmr'><dir id='8Gpmr'><q id='8Gpmr'></q></dir></style></legend>

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

      LinqToXml 沒有按預期處理 nillable 元素

      LinqToXml does not handle nillable elements as expected(LinqToXml 沒有按預期處理 nillable 元素)
    1. <small id='RK1XY'></small><noframes id='RK1XY'>

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

          <tbody id='RK1XY'></tbody>
      1. <legend id='RK1XY'><style id='RK1XY'><dir id='RK1XY'><q id='RK1XY'></q></dir></style></legend>
          <bdo id='RK1XY'></bdo><ul id='RK1XY'></ul>

                本文介紹了LinqToXml 沒有按預期處理 nillable 元素的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                根據 W3C 標準,如果你有一個 nil 值的可空元素,你應該像這樣格式化它:

                <myNillableElement xsi:nil="true"/>

                但是如果你使用這個 LinqToXml 語句...

                element.Add(新 XElement(ns + "myNillableElement", null);

                ...生成的 XML 是...

                <myNillableElement/>

                ...這是無效的.而且不僅根據 W3C 無效,根據 Microsoft 自己的 XML/XSD 驗證器無效.因此,下次驗證 XML 時,會出現錯誤.

                我是否缺少一些可以正確處理可空元素的開關?

                謝謝.

                解決方案

                LINQ to XML 大多不支持模式 - 它允許您驗證樹,但它不會從中派生任何特定的語義.您的錯誤是認為 null 應該以某種方式始終映射到 xsi:nil.W3C 規范中沒有這樣的要求(很明顯,因為它們不涵蓋任何類型的語言綁定).

                特別是,您調用的 XElement 構造函數實際上采用 object[] 類型的參數,這是一個子列表 - 沒有理由傳遞 null 應該與 xsi:nil 有任何相關性.無論如何,LINQ to XML 應該如何知道您正在生成根據某種架構有效的 XML,并且該架構中的一個特定元素具有 nilled="true"?p>

                According to W3C standards, if you have a nillable element with a nil value, you are supposed to format it like this:

                <myNillableElement xsi:nil="true" />
                

                But if you use this LinqToXml statement...

                element.Add(
                    new XElement(ns + "myNillableElement", null);
                

                ...the resulting XML is...

                <myNillableElement />
                

                ...which is invalid. And not just invalid according to W3C, invalid according to Microsoft's own XML/XSD validator. So, next time you validate your XML, you get errors.

                Am I missing some switch that can turn on correct handling of nillable elements?

                Thanks.

                解決方案

                LINQ to XML is mostly not schema-aware - it lets you validate the tree, but it doesn't derive any particular semantics from that. Your mistake is believing that null should somehow always map to xsi:nil. There's no such requirement in W3C specs (rather obviously, because they do not cover any kinds of language bindings).

                In particular, XElement constructor that you call actually takes an argument of type object[], which is a list of children - there's no reason why passing null to that should have any relevance to xsi:nil. In any case, how is LINQ to XML supposed to know that you're producing XML that is valid according to some schema, and that one particular element in this schema has nilled="true"?

                這篇關于LinqToXml 沒有按預期處理 nillable 元素的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)

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

                        <tbody id='OgQGB'></tbody>

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

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

                          <tfoot id='OgQGB'></tfoot>
                        1. 主站蜘蛛池模板: 综合五月 | 中文字幕人成乱码在线观看 | 精品一区二区不卡 | 成人h动漫精品一区二区器材 | 日韩美女在线看免费观看 | 中文字幕欧美在线观看 | 99精品免费 | 午夜影院在线观看视频 | 国产乱码精品1区2区3区 | 成人在线国产 | 国产成人综合一区二区三区 | 国产原创视频 | 91亚洲精品在线观看 | 久久国产精品一区二区三区 | 日韩中文字幕 | 久久久一二三区 | 黄a免费看 | 久草在线在线精品观看 | 国产精品久久久久久久久久免费看 | 欧美性大战xxxxx久久久 | 国产成人午夜高潮毛片 | 精品福利一区二区三区 | 欧美自拍一区 | 欧美精品一区在线 | 精品在线观看一区二区 | 激情五月婷婷在线 | 日韩a在线 | 日韩爱爱网站 | 日韩欧美国产成人一区二区 | 久久偷人| 一级毛片在线播放 | 久久精品播放 | 亚洲情综合五月天 | 中文字幕精品视频 | 日韩电影免费观看中文字幕 | 91成人免费看 | 四虎精品在线 | 激情欧美日韩一区二区 | 国产在线播 | 亚洲国产精品网站 | 中文字幕一区在线观看视频 |