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

  1. <legend id='Wd9o0'><style id='Wd9o0'><dir id='Wd9o0'><q id='Wd9o0'></q></dir></style></legend>

  2. <small id='Wd9o0'></small><noframes id='Wd9o0'>

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

    <tfoot id='Wd9o0'></tfoot>

    1. 在代碼中從 XML 創(chuàng)建 XSD

      Create XSD from XML in Code(在代碼中從 XML 創(chuàng)建 XSD)
          <bdo id='yQRym'></bdo><ul id='yQRym'></ul>
            <legend id='yQRym'><style id='yQRym'><dir id='yQRym'><q id='yQRym'></q></dir></style></legend>
                <tbody id='yQRym'></tbody>
              <i id='yQRym'><tr id='yQRym'><dt id='yQRym'><q id='yQRym'><span id='yQRym'><b id='yQRym'><form id='yQRym'><ins id='yQRym'></ins><ul id='yQRym'></ul><sub id='yQRym'></sub></form><legend id='yQRym'></legend><bdo id='yQRym'><pre id='yQRym'><center id='yQRym'></center></pre></bdo></b><th id='yQRym'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='yQRym'><tfoot id='yQRym'></tfoot><dl id='yQRym'><fieldset id='yQRym'></fieldset></dl></div>
              1. <small id='yQRym'></small><noframes id='yQRym'>

                <tfoot id='yQRym'></tfoot>
                本文介紹了在代碼中從 XML 創(chuàng)建 XSD的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我正在使用 MSDN 中的這段代碼從 XML 創(chuàng)建 XSD

                I am using this piece of code from MSDN to create an XSD from an XML

                XmlReader reader = XmlReader.Create("contosoBooks.xml");
                XmlSchemaSet schemaSet = new XmlSchemaSet();
                XmlSchemaInference schema = new XmlSchemaInference();
                
                schemaSet = schema.InferSchema(reader);
                
                foreach (XmlSchema s in schemaSet.Schemas())
                {
                   textbox.text = s.ToString();
                }
                

                我想根據(jù)我的 xml 文件輸出 .xsd.當我生成 .xsd 文件時,我得到的唯一內(nèi)容是:System.Xml.Schema.XmlSchema

                I want to output the .xsd based on my xml file. When I generate the .xsd file, the only content I get inside it is: System.Xml.Schema.XmlSchema

                當我使用 Visual Studio 選項生成 XSD 來創(chuàng)建架構(gòu)時,它會正確顯示.但是,我有超過 150 個 xml 文檔需要創(chuàng)建 XSD,因此需要一個編程選項.有人可以幫忙嗎?

                When I generate the XSD using Visual Studio option to create Schema, it comes out properly. However, I have over 150 xml docs that I need to create XSD for hence need a programmatic option. Can anyone help?

                推薦答案

                這就是你缺少的...而不是簡單地執(zhí)行 s.ToString(),而是這樣做:

                This is what you're missing... instead of simply doing s.ToString(), do this:

                XmlWriter writer;
                int count = 0;
                foreach (XmlSchema s in schemaSet.Schemas())
                {
                    writer = XmlWriter.Create((count++).ToString() + "_contosobooks.xsd");
                    s.Write(writer);
                    writer.Close();
                    Console.WriteLine("Done " + count);
                }
                reader.Close();
                

                然后您可以編寫適當?shù)倪壿媮砀鼉?yōu)雅地進行讀/寫,讀取許多 xml 文件并創(chuàng)建相應的 xsd 文件等.

                You can then write proper logic to do the read/write more gracefully, read many xml files and create corresponding xsd files, etc.

                我從這里獲取了 contosobooks.xml:https://code.google.com/p/code4cs/source/browse/trunk/AppCase/dNet/Xml/data/contosoBooks.xml?spec=svn135&r=135

                I took the contosobooks.xml from here: https://code.google.com/p/code4cs/source/browse/trunk/AppCase/dNet/Xml/data/contosoBooks.xml?spec=svn135&r=135

                輸出 xsd 為:

                <?xml version="1.0" encoding="utf-8"?>
                <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.contoso.com/books" xmlns:xs="http://www.w3.org/2001/XMLSchema">
                    <xs:element name="bookstore">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element maxOccurs="unbounded" name="book">
                                    <xs:complexType>
                                        <xs:sequence>
                                            <xs:element name="title" type="xs:string" />
                                            <xs:element name="author">
                                                <xs:complexType>
                                                    <xs:sequence>
                                                        <xs:element minOccurs="0" name="name" type="xs:string" />
                                                        <xs:element minOccurs="0" name="first-name" type="xs:string" />
                                                        <xs:element minOccurs="0" name="last-name" type="xs:string" />
                                                    </xs:sequence>
                                                </xs:complexType>
                                            </xs:element>
                                            <xs:element name="price" type="xs:decimal" />
                                        </xs:sequence>
                                        <xs:attribute name="genre" type="xs:string" use="required" />
                                        <xs:attribute name="publicationdate" type="xs:date" use="required" />
                                        <xs:attribute name="ISBN" type="xs:string" use="required" />
                                    </xs:complexType>
                                </xs:element>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                </xs:schema>
                

                這篇關于在代碼中從 XML 創(chuàng)建 XSD的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                相關文檔推薦

                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(從函數(shù)調(diào)用按鈕 OnClick)

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

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

                        <i id='I5pzh'><tr id='I5pzh'><dt id='I5pzh'><q id='I5pzh'><span id='I5pzh'><b id='I5pzh'><form id='I5pzh'><ins id='I5pzh'></ins><ul id='I5pzh'></ul><sub id='I5pzh'></sub></form><legend id='I5pzh'></legend><bdo id='I5pzh'><pre id='I5pzh'><center id='I5pzh'></center></pre></bdo></b><th id='I5pzh'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='I5pzh'><tfoot id='I5pzh'></tfoot><dl id='I5pzh'><fieldset id='I5pzh'></fieldset></dl></div>
                          <tbody id='I5pzh'></tbody>
                        • <bdo id='I5pzh'></bdo><ul id='I5pzh'></ul>
                          主站蜘蛛池模板: 99精品在线观看 | 一级免费在线视频 | 国产精品美女久久久久aⅴ国产馆 | 亚洲精品久久久一区二区三区 | 56pao在线| 午夜国产羞羞视频免费网站 | 精品www| 国产精品久久久亚洲 | 99综合在线 | 欧美一区二区久久 | 精品日韩 | 亚洲精品日韩在线 | 亚洲视频精品在线 | 亚洲高清视频在线观看 | 国产成人在线免费 | 午夜久久久久久久久久一区二区 | 在线观看免费黄色片 | 日韩精品一区在线 | 亚洲区一区二 | 国产日韩免费视频 | 中文字幕久久精品 | 国产精品7777777 | 国产偷录视频叫床高潮对白 | 久久青草av| 精品国产乱码久久久久久蜜退臀 | 在线免费观看毛片 | 91porn成人精品 | 欧美一区二区三区高清视频 | 中文字幕av网站 | aaa国产大片 | 成人在线视频一区二区三区 | 在线看一区二区三区 | 亚洲欧美一区二区三区在线 | 青青草精品视频 | 在线播放国产一区二区三区 | 国产成人精品一区二区三 | 国产精品久久久久久久久久东京 | 成人h免费观看视频 | 色就是色欧美 | 精品久久影院 | 国产欧美在线一区 |