package org.simantics.excel.poi.parser.streaming; import java.util.ArrayList; import java.util.List; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; public class XSSWorkbookHandler extends DefaultHandler { List sheets = new ArrayList(); public List getSheets() { return sheets; } public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException { // System.out.println(name); // for (int i = 0; i < attributes.getLength(); i++) { // System.out.println(" " + attributes.getLocalName(i) + "; "+attributes.getValue(i) + "; " + attributes.getType(i) ); // // } if(name.equals("sheet")) { String sheetName = attributes.getValue("name"); String sheetId = attributes.getValue("sheetId"); String id = attributes.getValue("id"); sheets.add(new SheetImpl(sheetName, Integer.parseInt(sheetId), id)); } } public void endElement(String uri, String localName, String name) throws SAXException { } public void characters(char[] ch, int start, int length) throws SAXException { } }