11

I am using xsd.exe to generate a C# class from a collection of xsd files. The xsd file makes use of the <xsd:documentation> tag to include useful descriptions. Example:

<xsd:complexType name="AddressType">
    <xsd:annotation>
        <xsd:documentation>A formatted or free form address and its intended use.</xsd:documentation>
    </xsd:annotation>

Unfortunately all of this is lost in the generated C# class. Interestingly each class has an empty remarks documentation tag attached to it.

/// <remarks/>

How can I include this documentation in the generated C# class (either in or documentation tags)?

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Jim McKeeth
  • 38,225
  • 23
  • 120
  • 194
  • 2
    This would be a useful feature to have this XSD.exe to generate the Summary on the objects based on the XSD / – Tony May 26 '18 at 19:21

1 Answers1

3

xsd.exe is based on Codedom.

You could disassemble xsd.exe, and add the functionality there and recompile. The code is reasonably simple.

I had modified it to skip some namespaces from xsd while generating code.[Otherwise If I include a common.xsd in 2 other xsds the class was getting generated twice.]

Granted, I had access to source proper itself [I was a developer at Microsoft], but the process should be simple with diassembled code as well.

Fakrudeen
  • 5,778
  • 7
  • 44
  • 70
  • 2
    And why Microsoft does not share this code? Other programmers will fix xsd.exe code and improve it for all for free. – bmi Sep 02 '20 at 12:33