开发者

Generate a data entry form dynamically from XSD including validation rules

开发者 https://www.devze.com 2023-01-22 10:30 出处:网络
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. T

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.

开发者_StackOverflowI 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.


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.

0

精彩评论

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

关注公众号