I have several types of XML document.
The format of (i.e. the elements in) each document type is defined in an XSD.
Is there a convenient way to create HTML elements (or ASP.NET controls) on an ASP.NET form, to display/edit the elements in (contents of) an XML document, given the XML document and/or the document's XSD definition as input?
Within the XML/XSD:
- Complex (i.e. parent) elements may contain sub-elements
- Simple elements are of type 'string', 'integer', 'list of string values', etc.: which should map to corresponding HTML input elements
- Elements are documented (labelled) using
<xs:annotation>
in the XSD (these would be suitable HTML<label>
elements for the corresponding<input>
elements). - Each element is required, not required, and/or there may be several of them, specified using
minOccurs
andmaxOccurs
in the XSD
As well as generating the ASP.NET form, when the user posts the completed form, the software should read the returned data and pack it into an XML document.
How to do this?
I can write software to parse the XSD and generate the forms myself but that seems like a lot of code to write in-house and maintain.