W3C home > Mailing lists > Public > www-forms@w3.org > January 2001

generating forms based on XML schemas

From: Patrick Lightbody <plightbo@cisco.com>
Date: Thu, 25 Jan 2001 18:45:27 -0800
Message-Id: <5.0.2.1.0.20010125184034.00ab2d90@ce-nfs-1.cisco.com>
To: www-forms@w3.org
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:21:48 GMT