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