public void endElement(String uri, String localName, String qName)
throws SAXException {
tagData = tagData.trim();
if (qName.equalsIgnoreCase("gnc:account")) {
recordType = "";
AccountDAO accountDAO = (AccountDAO)daoFactory.getDAO("account");
try {
if (this.eventListener != null)
this.eventListener.GNUCashEvent(new GNUCashEvent("Acocunt: " + currentAccount.getTitle()));
String where = "where ACCOUNT_ID = '" + currentAccount.getAccountID() + "'";
if (accountDAO.load(where, null, true).size() == 0)
accountDAO.create(currentAccount, false);
else
accountDAO.update(currentAccount, false);
}
catch (Exception ex) {
System.out.println("Error with account:\n" +
currentAccount.getTitle() + "\n" +
currentAccount.getAccountID());