Best XML parser for Java - just want to get specific fields
Posted on 2007-11-15
I have a decent sized XML input file, a few thousand lines, that contains and invoice with between 1 and n number of item loops, as well as some overall order info. I need to parse that data in a java servlet and insert the data in to a sql database. That is an over-simplification of the process, in reality some data may be missing and I need to get it elsewhere (another DB), or data may be in different places depending on the vendor (invoice may not have item loops and instead have total information and some items in comments).
My question is what is the best XML parser to use in Java to accomplish this (considering I'm a beginner). I think I need one that will load the whole document because I may need to randomly access elements all over the document. Is this something that should involve xquery or xpath, and maybe saxon?