• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

representing as XML

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?
 
Sri Sar
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
the XML file is created on the server using java.
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic