yatin thakore

Greenhorn
+ Follow
since Mar 27, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by yatin thakore

Hi shivani:
Sax is sequential reader, dom retains the whole object tree in memory. Both are fine for reading small documents, but if you need to read a large document, you may run into memory problems with DOM. Additionally, if you also want to change the data you are reading, then DOM is the way to go as SAX does not provide an easy way to do this.
If you are building an application in java, then i would recommend jdom as the way to go (http://www.jdom.org) as it combines best features of dom and sax.
yatin
[This message has been edited by yatin thakore (edited March 27, 2001).]
Hi sander:
If you are programming in java, then i would recommend using jdom in lieu of dom or sax parsers, because it combines the best features of both: you get the performance of SAX and the object-tree of dom. Typically, DOM model is not suitable for parsing large documents due to memory restrictions. On the other hand, SAX parsers are fast but are sequential and although you can read the data, it does not provide a way to hange the data easily.
However, you can use jdom's sax parser to get the speed and still get the object model so that you can modify data.
Ajit's link would provide more details. And also brett maclaughlin's book (java and xml). mclaughlin is one of the codevelopers of this api.
yatin

Originally posted by Sander Fieten:
Hi,
I've looked on the JDOM project page www.jdom.org , and what I've seen it just looks like another parser. I haven't looked into it further, but why should I use JDOM instead of other parsers?
greetings
Sander
[This message has been edited by Sander Fieten (edited March 16, 2001).]


Hi Patrick:
i also had similiar questions not too long back. In a nutshell, XML (X stands for extensible), extends the capability of html.
The tags in html are basically designed for presentation and are fixed by specification. For example, bold, table etc. define how your content will appear in a browser. However html tags give you no clue about the "data" in your content. Nor can you add other tags, or else the browser will be confused.
However, in xml you can make up your own tags and can also define the "grammer" of your tags. If your content is description of a library catalog, you can have tags such as <book>, <author>, <contents> etc.
What makes xml so useful is that it is quite simple and intutive. With the help of commonly available parsers, you can read your documents on any platform: windows, unix, mac etc. Moreover, with the help of stylesheets that go with the xml documents, you can present them in any format that you like (html, text, pdf etc).
So xml is a good choice if you want to collect/exchange data and it can do this in a platform-independent way. Xml can also be used to present this data in different formats. This is becoming an important application of xml: just by having different stylesheets, one can show the same document in a browser or in wireless devices. Xml is also used as "glue", a middleware to connect data from differnet sources.
And your last question, why xml and java go together so well? XML is platform-independent way to hold and transfer data, whereas java provides a platform-independent way to manipulate that data and develop applications that can use/modify the "data" in xml.
Hope this helps. Best way to appreciate and learn it is by applying it in a practical application that you might have. I highly recommend java and xml by brett mclaughlin and am anxious to read the new book by daconta and saganich promoted in this forum.
good luck.
yatin

Originally posted by Patrick Lentz:
Okay a real basic question or actually three...I hear more and more about XML. What exactly is it? What can I do with it? Should I get into it? Also it seems that XML is often used together with Java..any special reasons?
Sorry to ask these beginner questions
Patrick