Thank you for your response.
One problem I am having is that the form elements on the web page need to have unique names, but the values might be destined for elements with the same name. So I cannot simply name the form field to correspond with the element name in the XML document. Furthermore, a particular element might appear multiple times nested at different levels within the XML document. How will I know that form field "foo1" should populate the first <foo> element and form field "foo2" populate the second in the example below:
    <foo>["foo1" goes here]</foo>
        <foo>["foo2" goes here]</foo>
I am trying to hard-code as little as possible into the Java code while avoiding having form fields with ridiculously long and complex names.
-----Original Message-----
From: Namballa, Revathipathi [mailto:rnamballa@templeton.com]
Sent: Wednesday, September 12, 2001 12:10 PM
To: 'general@xml.apache.org'
Subject: RE: form field data "bound" to XML nodes?


if it is coming as a HTTP request you can take the request object and convert it into an XML message.

Step1: Get the request object(HTTPRequest).
Step2: From the request object get the name value pairs using the methods of the HTTPRequest     object.
Step3: Form the XML the way you want.

you can actually write java methods where in you can just input the name value pair as parameters and it builds the XML and keeps on appending the new name value pairs.

if you want more details please write back.


-----Original Message-----
From: David Lindquist [mailto:dlindquist@softroots.com]
Sent: Wednesday, September 12, 2001 2:40 PM
To: general@xml.apache.org
Subject: form field data "bound" to XML nodes?


Is there an easy way for form field data sent from a web page to populate
nodes in an XML file? I am trying to deal with the problem of
non-hierarchical data (name/value pairs sent from the form) having to find
its way into a hierarchical data structure (the XML file) on the server
side. To my knowledge, web browsers can only send form data via HTTP as
name/value pairs.

My only thoughts so far have been to devise a (ridiculously) complex naming
scheme for the form element names that would somehow correspond to an XPath
expression, or to build a JavaScript object representing the data structure
that could be serialized into XML and sent as the sole name/value pair.
These seem to me to be very kludgey.

There must be an easier way. Any ideas?


In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org