XmlSchemaClassGenerator
XmlSchemaClassGenerator copied to clipboard
Comments added to the documentation
It would nice if there was a way to have comments like these:
<xs:attribute name="Created" type="xs:dateTime">
<xs:annotation>
<xs:documentation>Date/time the request was created.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ID" type="xs:string">
<xs:annotation>
<xs:documentation>
Identifier may be provided by client application for internal use/diagnostics.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<!--
ATTRIBUTE DETAILS
Created: When the Report request was created using format "yyyy-mm-dd hh:mm:ss"
ID: Identifier of the request as assigned by the requesting service for internal use.
-->
</xs:complexType>
or these
<!--
EISSN is not an "official" identifier type, but included for backward compatibility. Use Online_ISSN
-->
<xsd:enumeration value="EISSN"/>
included in the documentation of the generated code
Good suggestion, but AFAICT the XML comments are not carried through to the XmlSchema objects we're using to model the schemas. Do you know a way to preserve the XML comments?
The documentation annotations in your first example are already used to build code comments.
I was referring only to the actual comments.
<!--
ATTRIBUTE DETAILS
Created: When the Report request was created using format "yyyy-mm-dd hh:mm:ss"
ID: Identifier of the request as assigned by the requesting service for internal use.
-->
the rest was just to try and give context.
I would love to try doing it myself, but don't have enough time right now to get into your code, so I am leaving two links here that should be useful in understanding how to parse comments into c#.
Of course the hard part is guessing what element they belong to :wink:
Maybe it could be based on a parameter passed in that lets the user decide if they want comments to be parsed?
http://stackoverflow.com/questions/6277966/reading-xml-comments-in-c-sharp http://stackoverflow.com/questions/20481741/c-sharp-reading-xml-comment-using-xdocument
Hello! you can put commets in addition to summary ///
@andrewkip Good idea. I've opened #81 to track this.