@@ -0,0 +1,2172 @@
+package com.equalize.xpi.af.modules.excel;%0A%0Aimport java.util.ArrayList;%0Aimport org.xml.sax.Attributes;%0Aimport org.xml.sax.SAXException;%0Aimport org.xml.sax.helpers.DefaultHandler;%0A%0Apublic class SAXSimpleParser extends DefaultHandler %7B%0A%0A%09private int level;%0A%09private String fieldName = null;%0A%09private String fieldValue = %22%22;%0A%09private boolean addHeader;%0A%0A%09private ArrayList%3CArrayList%3CString%3E%3E contents;%0A%09private ArrayList%3CString%3E row;%0A%09private ArrayList%3CString%3E header;%0A%0A%09public SAXSimpleParser (ArrayList%3CArrayList%3CString%3E%3E contents, boolean addHeader) %7B%0A%09%09this.contents = contents;%0A%09%09this.addHeader = addHeader;%0A%09%7D%0A%0A%09public void startDocument () throws SAXException %7B%0A%09%09this.level = 0;%0A%09%7D%0A%0A%09public void startElement(String namespaceURI, String localName, String rawName, Attributes atts) throws SAXException %7B%0A%09%09// At row level, create new arrays%0A%09%09if(this.level == 1) %7B%0A%09%09%09this.row = new ArrayList%3CString%3E();%0A%09%09%09if(this.addHeader) %7B%0A%09%09%09%09this.header  = new ArrayList%3CString%3E();%0A%09%09%09%7D%0A%09%09%7D%0A%09%09// At field level, get the field name%0A%09%09if(this.level == 2) %7B%0A%09%09%09this.fieldName = rawName;%0A%09%09%7D%0A%0A%09%09// Set level for next element%0A%09%09this.level++;%0A%09%7D%0A%0A%09public void endElement (String uri, String localName, String qName) throws SAXException %7B%0A%09%09// At end of field level, add the field name and saved field value to current row%0A%09%09if(this.fieldName != null) %7B%0A%09%09%09if(this.addHeader) %7B%0A%09%09%09%09this.header.add(this.fieldName);%0A%09%09%09%7D%0A%09%09%09this.row.add(this.fieldValue);%0A%09%09%7D%0A%09%09// Reset values%0A%09%09this.fieldName = null;%0A%09%09this.fieldValue = %22%22;%0A%09%09this.level--;%0A%0A%09%09// At end of row level, add contents of current row%0A%09%09if(this.level == 1) %7B%0A%09%09%09if(this.addHeader) %7B%0A%09%09%09%09this.contents.add(this.header);%0A%09%09%09%09this.addHeader = false;%0A%09%09%09%7D%0A%09%09%09this.contents.add(this.row);%0A%09%09%7D%0A%09%7D%0A%0A%09public void characters (char ch%5B%5D, int start, int length) throws SAXException %7B%0A%09%09// At field level, save value of field%0A%09%09if(this.fieldName != null) %7B%0A%09%09%09char%5B%5D ch2 = new char%5Blength%5D;%0A%09%09%09System.arraycopy(ch, start, ch2, 0, length);%0A%09%09%09// Concatenate into previous values, as for cases with special characters%0A%09%09%09// the content might be split into multiple chunks%0A%09%09%09this.fieldValue = this.fieldValue + new String(ch2);%0A%09%09%7D%0A%09%7D%0A%7D%0A%0A

Create SAXSimpleParser.java