log.info("Sheet: " + _workbook.getNumberOfSheets());
if (log.isDebugEnabled()) log.debug("Sheet: " + _workbook.getNumberOfSheets());
    private void parseTable(Node tableNode) {    	String sheetName = nodeValueForKey(tableNode, "name", "Unnamed Sheet " + (_workbook.getNumberOfSheets() + 1));    	    	String sheetCellStyle = nodeValueForKey(tableNode, "class", null);    	    	NSMutableDictionary sheetDict = new NSMutableDictionary();    	addEntriesFromNode(sheetDict, tableNode);    	    	HSSFSheet sheet = _workbook.createSheet(sheetName);    	NodeList rowNodes = tableNode.getChildNodes();    	    	//takeNumberValueForKey(tableNode, "defaultColumnWidthInPoints", workbook, null);    	takeNumberValueForKey(sheetDict, "defaultColumnWidth", sheet, null);    	takeNumberValueForKey(sheetDict, "defaultRowHeight", sheet, null);    	takeNumberValueForKey(sheetDict, "defaultRowHeightInPoints", sheet, null);    	    	log.info("Sheet: " + _workbook.getNumberOfSheets());    	    	int rowNum = 0;    	for (int j = 0; j < rowNodes.getLength(); j++) {    		Node rowNode = rowNodes.item(j);    		if(rowNode.getNodeType() == Node.ELEMENT_NODE    				&& "tr".equals(rowNode.getLocalName().toLowerCase())) {    			NSMutableDictionary rowDict = new NSMutableDictionary(sheetDict);    			addEntriesFromNode(rowDict, rowNode);    			    			//log.info("Row: " + rowNum);    			HSSFRow row = sheet.createRow(rowNum);    			    			rowNum = rowNum + 1;    			NodeList cellNodes = rowNode.getChildNodes();    			for (int k = 0; k < cellNodes.getLength(); k++) {    				Node cellNode = cellNodes.item(k);    				if(cellNode.getNodeType() == Node.ELEMENT_NODE    						&& ("td".equals(cellNode.getLocalName().toLowerCase())    								|| "th".equals(cellNode.getLocalName().toLowerCase()))) {    					HSSFCell cell = row.createCell((short) (row.getLastCellNum()+1));    					Object value = null;    					if(cellNode.getFirstChild() != null) {    	   					value = cellNode.getFirstChild().getNodeValue();     					}    					    					NSMutableDictionary cellDict = new NSMutableDictionary(rowDict);    					addEntriesFromNode(cellDict, cellNode);    					    					String cellTypeName = dictValueForKey(cellDict, "cellType", "CELL_TYPE_NUMERIC");    					String cellFormatName = dictValueForKey(cellDict, "cellFormat", "0.00;-;-0.00");    					    					log.debug(value + ": " + cellFormatName + "-" + cellTypeName);    					Integer cellType = (Integer)ERXKeyValueCodingUtilities.classValueForKey(HSSFCell.class, cellTypeName);    					    					switch(cellType.intValue()) {    						case HSSFCell.CELL_TYPE_FORMULA:    							cell.setCellType(HSSFCell.CELL_TYPE_FORMULA);    						cell.setCellFormula(value != null ? value.toString() : null);    						break;    						case HSSFCell.CELL_TYPE_NUMERIC:    							try {    								if(value != null) {    									NSNumberFormatter f = ERXNumberFormatter.numberFormatterForPattern(cellFormatName);    									Number numberValue = (Number)f.parseObject(value.toString());    									log.debug(f.pattern() + ": " + numberValue);    									if(numberValue != null) {    										cell.setCellValue(numberValue.doubleValue());    									}    								}    								cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC);    								break;    							} catch (ParseException e1) {    								log.info(e1);    							}    							    						case HSSFCell.CELL_TYPE_STRING:    						default:    							cell.setCellType(cellType.intValue());    						cell.setCellValue(value != null ? value.toString() : null);    						break;    					}    					    					String cellWidthString = nodeValueForKey(cellNode, "width", null);    					if(cellWidthString != null && cellWidthString.indexOf("%") < 0) {    						try {    							short width = Integer.valueOf(cellWidthString).shortValue();    							sheet.setColumnWidth(row.getLastCellNum(),(short) (width * 256));    						} catch (Exception ex) {    							log.warn(ex);    						}    					}    					    					String cellHeightString = nodeValueForKey(cellNode, "height", null);    					if(cellHeightString != null && cellHeightString.indexOf("%") < 0) {    						try {    							short height = Integer.valueOf(cellHeightString).shortValue();    							row.setHeightInPoints(height);    						} catch (Exception ex) {    							log.warn(ex);    						}    					}    					    					HSSFCellStyle style = styleWithDictionary(cellDict);    					    					if(style != null) {    						cell.setCellStyle(style);    					}    					    					String colspanString = dictValueForKey(cellDict, "colspan", "1");    					short colspan = Integer.valueOf(colspanString).shortValue();    					for(int col = 1; col < colspan; col++) {    						cell = row.createCell((short)(row.getLastCellNum()+1));    						if(style != null) {    							cell.setCellStyle(style);    						}    					}    					//log.info("Cell: " + value);    				}    			}    		}    	}    }