I'm not exactly sure what XML parser I should use when reading/writing XML for my application. I'm just starting to learn Java and I don't have the time to experiment with all the XML technology only to find that they don't suit my need. So I want to get some recommendation from other programmers based on their thought on the below requirements:
- I need to map XML elements to my Java class so that I can perform business logic on them.
- The XML will store cached data for an online application favouring client side data over server. That is, any information the user access on the server database will persist in the XML. When the app is online it will always retrieve data from the XML if available, or unless the state of the server database changed from another app session.
- Since the XML will essentially be an offline database, the reading and writing must be on demand. It shouldn't parse the whole XML file if it doesn't have to. That is, it follows some form of "filtering" convention - like a "where" clause.
- Continuing from point 3, it would be ideal to be able to limit the number of elements parsed with pagination.
You probably might see where I'm going with this. I'm looking for something similar to SQL, but for XML in Java. I'm not sure whether point 3 and 4 is possible - can a parser remember or hold on to the last position of the read operation?