Choice of XML parsing



I'm trying to figure out what parser or more generally, what type of parsing I should use.


I don't have any prior background in parsing and the in the java project I'm working on I will have to: -parse several files simultaneously non of them very large, so far I have not come across any 1 file larger than 200kB. There are rarely more than 4-5 levels (Child-Parentwise). -calculate the difference in the files and display these. Using something like treediff or similar. -Give option to merge the differences.


So my first question is wether to use a SAX- or DOM-based parser? SAX seems like a good choice at first but I it seems like there would be a lot of tedious grunt work to get this working smoothly? Is there any good tools that will map SAX to objects in java


But since I want to be able to edit the document something like xpath/xquery seems fairly easy but might be pretty slow when saving?


No comments:

Post a Comment