View Full Version : generating XML using JSP/Servlet

04-21-2004, 05:31 AM
using HTML/javascript, a form has been created. now the user makes selections using the form. i want to create a XML file that encapsulates the user selections ie this XML file should contain the selections made by the user. this XML file should also automatically change whenever the user makes new selections on the HTML form.
a part of the HTML form is given below:

<form name="theForm">
<select name="sel" onchange="loadFile();">
<option> Choose the map u prefer
<option value="C:\My Documents\usa.jpg" height=50 width=20>US
<option value="C:\My Documents\uk.jpg" height=50 width=20>UK
<option value="C:\My Documents\spain.jpg" height=50 width=20>Spain
<option value="C:\My Documents\greece.jpg" height=50 width=20>Greece

now as soon as the user selects say,"US" from the options, immediately the XML file should contain this selection. this XML file is then sent to the server where a server side program extracts data from the XML and does necessary processing.
my part is developing this dynamic XML. i have gone through some tutorials but was unsuccesful. i want to know exactly how to use JSP/Servlet to create the dynamic XML.
i just have no idea of how to start. if anybody can help me out by starting the code development, i will continue it and develop the code.
this code is to have been developed by another person who has left the project midway and now i am burdened with developing this code. i have no time to read tutorials. so i request u to give me a pseudo-code in JSP/servlet to generate the XML and i will proceed.
thanks in advance and eagerly looking forward to ur reply.