wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes representing as XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "representing as XML" Watch "representing as XML" New topic
Author

representing as XML

Sri Sar
Ranch Hand

Joined: Mar 25, 2004
Posts: 44
Hi,
i have created a XML file that contains the user selections made using
a HTML form. in this XML file, i have included entire file paths as
elements instead of just single data values. ie my XML is as follows:
<elem id="1">C:\My Documents\aa.jpg</elem>
<elem id="2">C:\My Documents\bb.jpg</elem>.......
actually in my HTML form, the user is given a set of jpeg images and he
has to choose one among them. similarly he is allowed to choose a text
file containing data from a set of text files. these are shown in XML as:
<data id="1">C:\My Documents\data1.txt</data>
<data id="2">C:\My Documents\data2.txt</data>
now say the user has selected "aa.jpg" and "data1.txt", how can i
modify my XML file so that the server side programs can extract only these
two selected files.
i am really finding it difficult to proceed and hope u help me out.
thanks in advance.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Sri Sar:
now say the user has selected "aa.jpg" and "data1.txt", how can i
modify my XML file so that the server side programs can extract only these
two selected files.

By removing all other elements but "aa.jpg" and "data1.txt"?
Maybe I'm not getting what you mean?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Sri Sar
Ranch Hand

Joined: Mar 25, 2004
Posts: 44
Hi Lasse,
you are right. actually the XML file should indicate the user's preferences. hence, only the two files, "aa.jpg" and data1.txt" need to be specified.
Sri Sar
Ranch Hand

Joined: Mar 25, 2004
Posts: 44
Hi,
actually the XML file that is created is a dynamic XML file that encapsulates the user's selections and this XML file is used by server-side programs on a server to interpret the user's choices and do calculations. for example a servlet extracts data from the two text file and performs operations like multiplying those values etc.
the main purpose of XML in this case is to be used for data exchange.
hope now u will be able to clarify my doubt.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I'm afraid I still don't quite understand... Where (physically) is the XML file created, and with what technology? On the client-side with JavaScript or on the server side with Java?
Sri Sar
Ranch Hand

Joined: Mar 25, 2004
Posts: 44
Hi,
the XML file is created on the server using java.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Sri Sar:
the XML file is created on the server using java.

Ok. And what is the question? The original "how can i
modify my XML file so that the server side programs can extract only these
two selected files?" seems a bit out-of-place if it's the server side program that creates the XML.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: representing as XML
 
Similar Threads
extracting data from XML file using servlets
parsing using Xerces
how to use servlets/JSP/EJB ???
advise on using XML in the application
is the DOM representation right???