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

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

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

      2. <tfoot id='fINr4'></tfoot>

        XmlSerialization 和 xsi:SchemaLocation (xsd.exe)

        时间:2023-06-04
          <i id='PV9g3'><tr id='PV9g3'><dt id='PV9g3'><q id='PV9g3'><span id='PV9g3'><b id='PV9g3'><form id='PV9g3'><ins id='PV9g3'></ins><ul id='PV9g3'></ul><sub id='PV9g3'></sub></form><legend id='PV9g3'></legend><bdo id='PV9g3'><pre id='PV9g3'><center id='PV9g3'></center></pre></bdo></b><th id='PV9g3'></th></span></q></dt></tr></i><div id='PV9g3'><tfoot id='PV9g3'></tfoot><dl id='PV9g3'><fieldset id='PV9g3'></fieldset></dl></div>
          • <legend id='PV9g3'><style id='PV9g3'><dir id='PV9g3'><q id='PV9g3'></q></dir></style></legend>

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

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

                  <tbody id='PV9g3'></tbody>
              1. <tfoot id='PV9g3'></tfoot>

                  本文介绍了XmlSerialization 和 xsi:SchemaLocation (xsd.exe)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我使用 xsd.exe 生成了一个用于读取/写入 GPX 文件的 C# 类.如何让生成的 XML 文件包含 xsi:schemaLocation 属性例如.

                  I used xsd.exe to generate a C# class for reading/writing GPX files. How do I get the resultant XML file to include the xsi:schemaLocation attribute eg.

                  我想要以下但 xsi:schemaLocation 总是丢失

                  I want the following but xsi:schemaLocation is always missing

                  <?xml version="1.0"?>
                  <gpx 
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                      xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                      version="1.1" 
                      xmlns="http://www.topografix.com/GPX/1/1"
                      creator="ExpertGPS 1.1 - http://www.topografix.com"
                      xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
                  </gpx>
                  

                  推荐答案

                  将此添加到您生成的 C# 类中:

                  Add this to your generated C# class:

                  [XmlAttribute("schemaLocation", Namespace = XmlSchema.InstanceNamespace)]
                  public string xsiSchemaLocation = "http://www.topografix.com/GPX/1/1 " +
                                                    "http://www.topografix.com/GPX/1/1/gpx.xsd";
                  

                  显然 xsd.exe 工具 不会生成 schemaLocation 属性.

                  Apparently the xsd.exe tool does not generate the schemaLocation attribute.

                  这篇关于XmlSerialization 和 xsi:SchemaLocation (xsd.exe)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:将 XSD 转换为 SQL 关系表 下一篇:如何使 dotnet webservice 设置 minOccurs=“1";在字

                  相关文章

                  最新文章

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

                      <i id='FtqRI'><tr id='FtqRI'><dt id='FtqRI'><q id='FtqRI'><span id='FtqRI'><b id='FtqRI'><form id='FtqRI'><ins id='FtqRI'></ins><ul id='FtqRI'></ul><sub id='FtqRI'></sub></form><legend id='FtqRI'></legend><bdo id='FtqRI'><pre id='FtqRI'><center id='FtqRI'></center></pre></bdo></b><th id='FtqRI'></th></span></q></dt></tr></i><div id='FtqRI'><tfoot id='FtqRI'></tfoot><dl id='FtqRI'><fieldset id='FtqRI'></fieldset></dl></div>
                    1. <small id='FtqRI'></small><noframes id='FtqRI'>

                      <tfoot id='FtqRI'></tfoot>
                        <bdo id='FtqRI'></bdo><ul id='FtqRI'></ul>