开发者

How to include the xsd:documentation in the C# class generated with XSD.exe?

开发者 https://www.devze.com 2022-12-19 03:12 出处:网络
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:

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 ea开发者_运维技巧ch 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)?


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.


Sorry, there's no way to do this.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号