aspose file tools*
The moose likes XML and Related Technologies and the fly likes Newbie Question: XML on Java 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 "Newbie Question: XML on Java" Watch "Newbie Question: XML on Java" New topic
Author

Newbie Question: XML on Java

Mark Fletcher
Ranch Hand

Joined: Dec 08, 2001
Posts: 897
Hi,
Im about to start work on an application in Java which reads and writes XML files. My current understanding is that there are many API's for Java which can parse XML.
I was wondering if anyone out there could point me to any articles which compare and contrast these API's or could inform me directly of the pros and cons of each.
Previously my experience with XML has been using the MSXML API on Windows.
Thanks and Best Regards,
Mark


Mark Fletcher - http://www.markfletcher.org/blog
I had some Java certs, but they're too old now...
bernd pier
Ranch Hand

Joined: Jun 21, 2002
Posts: 30
hey mark,
i knew SAX,DOM,JDOM,JAXP to parse xml.
i`m just a beginner in java and xml, but i have some links for you:
DOM
http://www.jcpohl.de/technik/tut1dom.html
http://www.w3c.com //this is the reference side including tutorials
the main difference between DOM and SAX is, that DOM hold the XML in a tree structure and you can access to any level, node or childnode to any time.
SAX parse the XML file line after line, so if SAX is in level 4 of the XML structure it`s impossible to access to level 2 or level 5. level 2 is parsed and lost and level 5 will be parsed.
when the XML file is very big, the DOM parser needs a lot of resources of cpu and memory to hold it and then it`s better to use the SAX parser.
at least you need a parser, i prefer xerces from apache.
i hope this help`s.
best wiches
bernd
Mark Fletcher
Ranch Hand

Joined: Dec 08, 2001
Posts: 897
Hi Bernd,
Thanks for the info. I'll probably give Xerces a look...
Cheers,
Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Newbie Question: XML on Java