Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XSD for XML documentation generated for C#? [closed]

Does anyone know if there is an XSD file somewhere that can be used to validate the XML documentation that gets generated when you compile a C# project with the /doc option?

I want to modify that file manually after it's been generated and I'm looking for an easy way to confirm that I haven't damaged the structure of the file.

Thanks.

like image 899
Rhy Mednick Avatar asked Jul 06 '10 17:07

Rhy Mednick


2 Answers

I finally broke down and wrote one: XSD for Xml Comments for .NET Documentation

like image 171
csharptest.net Avatar answered Sep 22 '22 06:09

csharptest.net


Stumbled across this old question today.. I didn't see this by looking at Microsoft's documentation, nor when looking at other projects that I thought might have an interest in developing such a schema; namely, the sources for the Sandcastle and (long-defunct) NDoc projects.

Short of stepping back to try to define a schema on your own, one thing I could suggest would be to use one of the many tools that will generate an XSD from XML. Microsoft includes XSD.EXE as part of Visual Studio and its SDKs.

You could write up dummy source that exercises each of the XML documentation comment tags, build the XML documentation file for it, then use XSD.EXE. to generate an XSD from that, and use it to validate the XML doc after your processing is done. But I think that could turn out to be less trivial than it sounds.

Also, XML documentation comments refer to types and code elements, and there are many things a schema won't catch; e.g., verifying that the name attribute of a <param> tag still refers to an actual parameter name in your C# source. The compiler verifies such elements at build time. But if you post-process the XML documentation, you would need a custom tool that had a reference to the original C# source or generated assemblies to re-verify such references.

like image 35
Andrew Brown Avatar answered Sep 24 '22 06:09

Andrew Brown