久久久久久久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的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

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

                我正在使用 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.當(dāng)我生成 .xsd 文件時(shí),我得到的唯一內(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

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

                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();
                

                然后您可以編寫適當(dāng)?shù)倪壿媮砀鼉?yōu)雅地進(jìn)行讀/寫,讀取許多 xml 文件并創(chuàng)建相應(yī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>
                

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

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

                相關(guān)文檔推薦

                What are good algorithms for vehicle license plate detection?(車牌檢測有哪些好的算法?)
                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)

                      <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>
                          主站蜘蛛池模板: 97久久精品午夜一区二区 | 欧美一区二区三区在线观看 | 在线观看免费观看在线91 | 日韩欧美一级 | 91久久| 国产成人午夜高潮毛片 | 精品视频一区二区三区在线观看 | 国产精品久久久久9999鸭 | 精品国产乱码一区二区三区a | 国产精品99久久久久久动医院 | 激情av在线 | 请别相信他免费喜剧电影在线观看 | 国产四区 | 午夜精品一区二区三区在线观看 | 91精品国产一区二区三区 | 亚洲精品一区二区 | 国产美女黄色片 | 精品欧美黑人一区二区三区 | 国产精品亚洲第一 | 欧美亚洲国产一区二区三区 | 黄网免费看| 亚洲欧美中文日韩在线v日本 | 日韩一区二区福利视频 | 成人精品福利 | 一区二区国产在线观看 | 日本在线中文 | 一区二区三区四区在线视频 | 97人人澡人人爽91综合色 | 欧美一区二区三区 | 国产日韩一区二区三区 | 亚洲精品粉嫩美女一区 | 日韩欧美一区二区三区免费看 | 精品二区视频 | 久久久www| 国产综合久久 | 日本超碰 | 91麻豆蜜桃一区二区三区 | 欧美日韩高清 | 成人国产精品一级毛片视频毛片 | 精品一区二区免费视频 | 国产福利精品一区 |