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: <>
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" 
         <xsd:element name="foo" type="fooType">
                         <xsd:documentation>Comment describing your root 
         <xsd:complexType name="fooType">
                         <xsd:element name="top" type="xsd:string"/>
                         <xsd:element name="bar" type="xsd:string" 
                         <xsd:element name="end" type="xsd:string"/>

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.

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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:04 UTC