tags:

views:

498

answers:

3

I have a requirement where i need to generate html forms on the fly based on many different xml schema's (as of now i have 20 of them and the count keeps increasing). I need to collect data from the user to create instance docs corresponding to each of them and then store the instance docs in db....

challenges 1) schema has lot of unbounded complex types. so we doesnt know in advance the number and type of input types to be created. so pre-creating html etc is not an option 2) even if i can handle generation of the form on the fly, the problem is collecting the data entered..as forms generated dynamically should/will have dynamic id/names for input types

Can anyone suggest the best way to implement this?

thank you in advance

+1  A: 

It seems to me like a clear case for XSLT.

Generating HTML from XML through XSLT is the primary goal of XSLT.

As for the id/names, you can create an XSLT which will also generate a set of id/names in a way that you can use.

Daniel
Damn, beat me to it. ;) +1 for XSLT, it's definitely the way to go here.
musicfreak
Then improve on my answer with one of your own. I'm not feeling like writing examples and such, but if he doesn't know XSLT, he might well need a few.
Daniel
A: 

We had a problem somewhat like this. One of our team thought that we ought to be able to create a web form UI on the fly to accept data conforming to an XSD. It turned out that this is very difficult ... given all the complexity of full XSD. So we ended up inventing our own schema language (which was both simpler and richer than XSD) and using this as the basis for generating our UI layouts. We also implemented a tool-chain for creating and validating the schemas and for generating equivalent XSDs and OWL schemas.

Stephen C
A: 

Use WSDL2XForms to create XForms from XML Schemas (XSD). Then publish them with Chiba (chiba.sourceforge.net) - it converts these XForms to standard HTML forms on the server side.

erwinston
thx a bunch for the pointer...but there is no files to downlaod...am i missing something
Pangea
you can download the WAR from http://sourceforge.net/projects/chiba/files/
erwinston