• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is this XML???

 
Sri Sar
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
using HTML/JS, i have created a new window that contains thet contents as given below:

<desc>
<name>sam</name>
<age>23</name>
</desc>

in my form, i had a set of select tags with options. once the user has made his selections, i use a function named change() with the pseudo code as given below:


the result of executing this function is the set of tags as given above.
now my questions are:
(1) can i say that i have created a XML file???
(2) if it is a XML file, without using a parser, can i extract the value of the name and age tags using servlets or JSP?
thanks in advance
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(1) can i say that i have created a XML file???

No, but you can say that you have created an XML document...

(2) if it is a XML file, without using a parser, can i extract the value of the name and age tags using servlets or JSP?
No, you can't, since the window you created with JavaScript gets created completely on the client-side -- the server doesn't know that the browser has executed the JavaScript function.

If you want to send the XML document for processing on the server-side, you should turn to our HTML/JavaScript forum for help in doing that.
 
Sri Sar
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
thank u very much for the reply. can u give me the difference between a XML document and a XML file??
thanks in advance
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sri Sar:
can u give me the difference between a XML document and a XML file??

An XML document is "any" instance of an XML tree while an XML file is a file containing an XML document.

For example,
String foo = "<?xml version='1.0'?><foo><bar/></foo>";
can be called an "XML document" but it's not an "XML file" until you've physically written that XML data into a file in the file system.
 
Sri Sar
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi lasse,
thank u very much for explaining the difference between an XML file and an XML document,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic