Question

Is there anything around that can read an XSD schema and dynamically create a (Windows C#) data entry form? It would also need to read the type definitions and use them to validate the data entered. The data would then be save as an XML file.

I would prefer it was a dynamic form since the XSD could, and probably will change. I'd rather not have to rebuild and redistribute the app every time it changes.

I have seen XSD2code which looks promising but doesn't seem to be dynamic.

The XML data editor on Codeplex looks promising but it threw an unhandled exception when I fed it an XSD I will use. Also, I don't think it does validation rules.

Was it helpful?

Solution

I am not sure if this can help you with this dynamic thing, but better than XSD2Code is LinqToXSD. At first, you build an .cs objects with LinqToXSD, then you add it into your project. Then you add a new data source object and set binding to your .cs object. Don't forget to add proper references to XML.Schema.Linq.dll to your project. Now you can add binded resources to your WinForms. I am dealing with the validation right now, I hope it goes fine with that, I will let you know.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top