This code will parse the provided "example.xml" file, and immediately insert the processed data into a database as each row tag is parsed, instead of building up an in-memory representation. Actually, in order to keep this example simple and easy to run, sql insert statements are printed out rather than actually performing database inserts, but the principle remains.
Very verbose comments are included here, as this class is intended as a tutorial; if you look closely at method "addRules", you will see that the amount of code required to use the Digester is actually quite low.
Usage: java Main example.xml
|Constructor and Description|
Copyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.