File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Journal Article - The Trail Guide - The three rules of using XML and Java

 
Dirk Schreckmann
Sheriff
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The just-released September 2004 edition of The JavaRanch Journal includes an article by Paul Wheaton, "The Trail Guide - The three rules of using XML and Java".

Please use this thread to comment on and discuss the article.
 
Daniel Mayer
Ranch Hand
Posts: 103
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Personally, I prefer Dom4J over JDom. It seems to have the more complete API, while still coming natural to a Java developer.

And I see one drawback using an XML-serializer like XStream - The XML structure is only implicitely defined by the object structure, so by refactoring your design, you can accidentally become incompatible to prior versions.

For things like configuration files I therefore prefer to define the XML structure via a schema and let the java classes be generated from it; for example using JAXB.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul, thanks for mentioning XStream. I'll be able to put this to good use. Oh wait, we aren't suppose to use XML are we?
 
Vladas Razas
Ranch Hand
Posts: 385
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Haha, I fell at rule 2 and 3. Using regular DOM... But it was worth it because I better understood XML now. Had to deal with whitespace text nodes etc myself

Regards
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic