I am writing an XSD parser which dynamically builds simple WinForm (based on input XSD scheme).
I want to use only xsd defined structures, not adding anything beyond xsd standard elements.Questions:
- I want xsd:element to define a control. How to distinguish which xsd:element defines which control type (especially the bolded ones)? (basic are TextBox, TextArea(multiline textbox), ComboBox, RadioGroup(group of radiobuttons), DateTimePicker, CheckBox, P开发者_Python百科anel, Button).
- How about labels - maybe is it better to define them inside xsd:element of other control containing data (TextBox, etc.)? How ?
I need this parser to enable the clients to generate a schema by 3rd party tool then populate the XSD into my app and open WinForm (without need of programming it) and in further steps produce xml with data and some output.
I think you can get a lot of ideas by having a look at XMLSpy. Specifically, their Stylevision technology is probably very similar to what you are trying to achieve.
I think it also highlights a bit of an issue with your concept in general - an XSD does not contain all the necessary information regarding how to capture the data that the XML will represent. You could assume default editors for specific types, etc, but pretty soon you will run into cases where someone wants something to work differently, and XSD will not, by default, support it. I am pretty sure you will end up with some non-standard extensions, which no out of the box tool will support, or your own XML-language for defining screens. Nevertheless, I suggest having a look at XMLSpy, some of their tooling is excellent and should give you some ideas.
精彩评论