Using xsd.exe to generate classes from an XML schema...how do I document the code?

SamCaldwell
SamCaldwell used Ask the Experts™
on
Currently I have a macro in my visual studio environment that downloads a schema file posted by the server-side people then runs that through XSD.EXE to generate my classes for processing SOAP transactions with that server.

I would like to document that code better by revising the XML schema to add documentation that will appear in object browser as well as the generated code using the XML '''<REMARKS> created by xsd.  But how do you encode this documentation in the schema so that the generated classes are documented properly?

You have no idea how much this would simplify communication in my life....  ;-)
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Sounds like a good idea, but I doubt that xsd has been programmed to look at XML remarks.

Dabas

Author

Commented:
I know that xml remarks using '<!-- -->' are ignored.  But the xsd.exe utility generates '''<remarks /> tags which to me suggests there MUST logically be some way of populating these tags with information...
Yep, you are right

The code actually has tags that look like this: (In C#)

        /// <remarks/>
The triple / adds to the documentation of the generated file and I assume it is intended for the user to manually add the remarks into the C# code.

Having said that, it should not be difficult to write a C# program that will then take the code and add the remarks in a certain way.
For example, by reading your xsd file and replacing the <remarks> with whatever you have in the <!-- -->

Dabas
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

Author

Commented:
I doubt it is reasonable (even for Microsoft) that xsd.exe would generate '''<REMARKS> and not provide a means of populating the fields.

Does anyone else have any ideas on this one?
Sam:

It is reasonable (even for Microsoft) to include such a means in their documentation.
xsd.exe /? does not provide any.

Dabas

Author

Commented:
Does anyone know of any documentation other than xsd /?

Author

Commented:
Are there any third-party applications that will accomplish this end?
Sam:
As I wrote in a previous post, it is not difficult to write a C# program that will do what you want.

Dabas
As per the deletion request: There is no solution to the problem as requested by the asker.
That statement in itself is the answer to the question, which I hinted at with my responses.
I also suggested that it is easy to write a C# program to do what the asker wants to do, but he did not express an interest in seeing such a solution either.

In short: The ANSWER to the problem is that there is no such solution. This does not mean that the question has not been answered, and it has PAQ value for other members that might go down this path.

Dabas

Author

Commented:
If there is no solution then marking "no solution" as an "accepted solution" will be misleading in the future once a successful solution is posted given time.

There have been been many times where I have found dead end "solutions" such as that proposed here in the objection where the dead end would have been avoided had everyone simply agreed to walk away from the problem and allow the problem to exist.

One's quest for points should not overrule one's quest for solutions, answers and the general welfare of the community on EE.

Author

Commented:
To avoid a waste of time, I am simply closing this question.  The solution proposed is not a cost-effective solution

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial