This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes advise on using XML in the application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "advise on using XML in the application" Watch "advise on using XML in the application" New topic
Author

advise on using XML in the application

Ella Rath
Greenhorn

Joined: Apr 19, 2004
Posts: 17
Hi,
i need ur advise on how to use XML for developing a simple application.
in my application, the user is presented with a HTML form by which he
can make necessary selections. the form template is given below:
<form name="theForm">
<select name="sel" onchange="loadFile();">
<option> Choose the map u prefer
<option value="C:\My Documents\usa.jpg">US
<option value="C:\My Documents\uk.jpg" >UK
<option value="C:\My Documents\spain.jpg">Spain
<option value="C:\My Documents\greece.jpg">Greece
</select>
</form>

in the above application , the user chooses a map and some data files and on the server side, some processing is done on the user selected map using the data also selected by the user and the final map is displayed back to the user.
i have been asked to use XML in the above situation(probably for data exchange!!). i need to design a XML file that encapsulates the choices made by the user and this XML file has to be sent to the server via HTTP.
the server-side programs are to interpret this XML file and do necessary procesing. my questions are:
1) is it possible to design such a XML file? this XML file should be a dynamic one that should change each time the user makes selection using the form.
2) should it be created on the client end or on the server end??
i need to necessarily use XML in the above scenario and i am in desperate need of ur advise and suggestions..
thanks in advance and eagerly looking forward to ur reply.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
1) is it possible to design such a XML file? this XML file should be a dynamic one that should change each time the user makes selection using the form.
Yes, it is possible. How to create the XML document dynamically on the client-side is something you need to ask in the JavaScript forum.
2) should it be created on the client end or on the server end??
i need to necessarily use XML in the above scenario and i am in desperate need of ur advise and suggestions.
Why do you need to use XML? Yes, I know that your boss told you to, but that's not a reason. If it doesn't matter how you use XML as long as you use it somehow, the easiest way might be to submit the HTML form as usual and have your server-side code construct the XML document.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
Consider Paul's rocket mass heater.
 
subject: advise on using XML in the application