I was hoping to reuse some viewmodel classes with dataannotations to generate xsd files for the purpose of validating (and documenting) xml files from 3rd party systems. Xsd.exe generates the .xsd files fine, but dataannotation attributes like [Required] are not reflected in the xsd with f.ex. minOccurs=1.
What options (if any) do I have here? The "easiest" would probably be to create my own xsd generation using reflection. Or could I get away with just creating the extra validation attributes in a separate xsd and use both when validating xml files towards it?
Any other ideas?
I don't know of any other solution.
I did write an XSD generator using reflection (to be able to include comments in my case) - it is quite a lot of work but definitely feasible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With