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

  • <small id='7UjrV'></small><noframes id='7UjrV'>

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

      1. <tfoot id='7UjrV'></tfoot>
      2. <legend id='7UjrV'><style id='7UjrV'><dir id='7UjrV'><q id='7UjrV'></q></dir></style></legend>
          <bdo id='7UjrV'></bdo><ul id='7UjrV'></ul>

        將 XSD 與包含一起使用

        Using XSDs with includes(將 XSD 與包含一起使用)

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

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

                  <tbody id='O7kAC'></tbody>
              • <tfoot id='O7kAC'></tfoot>

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

                  本文介紹了將 XSD 與包含一起使用的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  這是一個 XSD:

                  <?xml version="1.0"?>
                  <xsd:schema 
                  elementFormDefault='unqualified' 
                  attributeFormDefault='unqualified' 
                  xmlns:xsd='http://www.w3.org/2001/XMLSchema' 
                  >
                  
                    <xsd:simpleType name='TheSimpleType'>
                      <xsd:restriction base='xsd:string' />
                    </xsd:simpleType>
                  </xsd:schema>
                  

                  這是第二個 XSD,包括上面的一個:

                  Here is a second XSD that includes the one above:

                  <?xml version="1.0" encoding="UTF-8" ?>
                  <xsd:schema 
                  elementFormDefault='unqualified' 
                  attributeFormDefault='unqualified' 
                  xmlns:xsd='http://www.w3.org/2001/XMLSchema' 
                  targetNamespace='a'
                  xmlns='a'
                  >
                  
                    <xsd:include schemaLocation='Include.xsd' />
                  
                    <xsd:element name = "TheElement" >
                    <xsd:complexType>
                    <xsd:attribute name="Code" type="TheSimpleType" use="required"/>
                    </xsd:complexType>
                    </xsd:element>
                  </xsd:schema>
                  

                  我需要將(第二個)XSD 讀入 C# 并且:

                  I need to read the (second) XSD into C# and:

                  1. 檢查它是否是有效的 XSD,并且
                  2. 根據它驗證文檔.

                  這里有一些 C# 可以在架構中閱讀:

                  Here is some C# to read in the schemata:

                      XmlSchemaSet schemaSet = new XmlSchemaSet();
                      foreach (string sd in Schemas)
                      {
                          using (XmlReader r = XmlReader.Create(new FileStream(sd, FileMode.Open)))
                          {
                              schemaSet.Add(XmlSchema.Read(r, null));
                          }
                      }
                      schemaSet.CompilationSettings = new XmlSchemaCompilationSettings();
                      schemaSet.Compile();
                  

                  .Compile() 失敗,因為類型 'a:TheSimpleType' 未聲明,或者不是簡單類型."

                  The .Compile() fails because "Type 'a:TheSimpleType' is not declared, or is not a simple type."

                  但是,如果滿足以下任一條件,它就會起作用:

                  However, it works if either:

                  • 命名空間已從架構中移除,或者
                  • 命名空間被添加到包含中.

                  問題是:如何在不編輯模式的情況下讓 C# 接受它?

                  The question is: how do I get C# to accept it without editing the schemata?

                  我懷疑問題在于,雖然我已將兩個模式都放入 XmlSchemaSet,但我仍然需要告訴 C# 一個包含在另一個中,即它自己并沒有解決.事實上,如果我只告訴 XmlSchemaSet 主 XSD(而不是包含)(都沒有(或有)命名空間),那么類型 'TheSimpleType' 沒有聲明,或者不是簡單類型."

                  I suspect the problem is that although I have put both schemata into the XmlSchemaSet, I still need to tell C# that one is included into the other, i.e., it hasn't worked it out for itself. Indeed, if I only tell the XmlSchemaSet about the main XSD (and not the include) (both without (or with) namespaces) then "Type 'TheSimpleType' is not declared, or is not a simple type."

                  因此這似乎是一個關于解決的問題包括:如何?!

                  Thus this seems to be a question about resolving includes: how?!

                  推薦答案

                  問題在于在線打開模式讀取的方式:

                  The problem is with the way the schema is opened for reading on the line:

                  XmlReader.Create(new FileStream(sd, FileMode.Open)
                  

                  我必須編寫自己的 XmlResolver 才能看到如何解析包含文件的路徑:它來自可執行文件的目錄,而不是來自父架構的目錄.問題是父模式沒有得到它的 BaseURI 集.以下是必須打開模式的方式:

                  I had to write my own XmlResolver before I could see how the paths to the include files were being resolved: it was from the directory of the executable and not from the directory of the parent schema. The problem is that the parent schema was not getting its BaseURI set. Here's how the schema must be opened:

                  XmlReader.Create(new FileStream(pathname, FileMode.Open, FileAccess.Read),null, pathname)
                  

                  這篇關于將 XSD 與包含一起使用的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)

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

                    <tfoot id='8bWCT'></tfoot>
                  1. <legend id='8bWCT'><style id='8bWCT'><dir id='8bWCT'><q id='8bWCT'></q></dir></style></legend>

                        <bdo id='8bWCT'></bdo><ul id='8bWCT'></ul>
                      • <small id='8bWCT'></small><noframes id='8bWCT'>

                          1. 主站蜘蛛池模板: 户外露出一区二区三区 | 午夜激情小视频 | 中文字幕成人免费视频 | 伊人久久麻豆 | 精品视频一区二区三区在线观看 | 午夜精品一区二区三区在线观看 | 日本久久一区 | 欧美性生活免费 | 91久色 | 久久久综合色 | 欧美网站一区二区 | 一区二区视频在线 | 婷婷国产一区二区三区 | 中文字幕国产 | japan25hdxxxx日本| 国产欧美日韩 | 国产激情在线观看 | 亚洲精品福利视频 | 欧美日韩黄 | 亚洲欧美日韩精品久久亚洲区 | 欧美成人第一页 | 国产精品免费看 | 国产精品成人69xxx免费视频 | 久久在线| 日韩免费在线观看视频 | 国产成人免费在线 | 欧美色综合 | 欧美中文字幕一区二区 | 免费亚洲网站 | 91在线免费视频 | 日本不卡免费新一二三区 | 久久亚洲国产精品 | 欧美精品网站 | 国产欧美日韩在线播放 | 欧美一区二区三区久久精品视 | www.日本在线 | 91极品尤物在线播放国产 | 成人亚洲 | 中文字幕欧美一区 | 激情五月婷婷 | 日韩在线免费视频 |