• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is there a guide for what XML classes/principles work best depending on what you need to do?

 
J Westland
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi -

I have used a little XML in Java using DOM and Nodes/Document/Nodelist/Element classes/interfaces so I know how to read in an XML file. OK for those things it seems simple enough.

I could find out that DOM is best for if you will use information from the XML document many times, as SAX parses item by item and is therefore not so efficient if you need to do lots of reading/manipulation. However SAX will work if you don't want to/can't have the whole document in memory.

I wrote something basic for work but a colleague of mine used XPaths for example I don't. There is a reason for that, but I find it hard to work out when to use what XML classes

Then I opened the O'Reilly xml book and got a case of total information overload.
XPATH, XSLT, XQL...woa! There was not really clear overview of when to use what (OK, it's a reference not a HeadFirst book I know...) in the end I got a lot further with some basic tutorials and simply reading the JAVA API (thank you SCJP qualification)

I saw some XML books on Amazon.com but I don't really care about learning how to use something but more what to use when from a practical point of view. And since there's no headfirst XML... ;)

What book/site do you recommend on learning XML and wanting to understand what you're doing and why?



 
Jamie Zhang
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you are basically right about DOM and SAX, but XML processin technology has proressed a bit there are more options available for you to consider

1. StAX is similar to SAX as a streaming XML parser, but is generally considered easier to use since you pull nodes from XML, instead of receiving events, StAX's limitation is pretty similar to SAX otherwise.

2. VTD-XML basically does what DOM does, but is a lot more efficient in memory usage (1/3~1/5 of what DOM uses), and up to 12x faster in perfomrance, it additionally supports indexing, full XPath support, incremental update, and cut/paste/splitting/assembling,

http://vtd-xml.sf.net
 
J Westland
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tx the vtd-xml sounds interesting
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic