generating forms based on XML schemas

I am not completely familiar with XForms...

I need to present an XHTML output (from a Java servlet of some sort) that 
prompts a user for input based on an XML Schema (the servlet does not know 
the nature of the schema). For example, say my schema is:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" 
elementFormDefault="qualified">
         <xsd:element name="foo" type="fooType">
                 <xsd:annotation>
                         <xsd:documentation>Comment describing your root 
element</xsd:documentation>
                 </xsd:annotation>
         </xsd:element>
         <xsd:complexType name="fooType">
                 <xsd:sequence>
                         <xsd:element name="top" type="xsd:string"/>
                         <xsd:element name="bar" type="xsd:string" 
maxOccurs="unbounded"/>
                         <xsd:element name="end" type="xsd:string"/>
                 </xsd:sequence>
         </xsd:complexType>
</xsd:schema>

What I envision is when a user wants to create a new document based off of 
foo.xsd, he would see this HTML page:

Top: [ text field]
Foo: [text field] (ADD FOO - button)
End: [text field]

If a user clicks on "ADD FOO", then the page comes back like this:

Top: [ text field]
Foo: [text field] (ADD FOO - button)
Foo: [text field] (ADD FOO - button)
End: [text field]

And so on...

When the user clicks "Save", and XML file is generated based off of the 
input from the form and written to an XML file. There are no XML parsers 
that easily assist with determining a list of "valid elements" like I would 
need to present in the web page forms.

Sorry if this question is completely off the wall, but I'm desperate for an 
answer. Thanks.

-Pat

Received on Thursday, 25 January 2001 21:45:28 UTC