Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Newbie Question: XML on Java

 
Mark Fletcher
Ranch Hand
Posts: 897
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
bernd pier
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 897
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bernd,
Thanks for the info. I'll probably give Xerces a look...
Cheers,
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic