public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
if (logger.isDebugEnabled())
logger.debug("startElement(uri={}, localName={}, qName={}, attributes={}) - start", new Object[] { uri, localName, qName, attributes });
try {
ITableMetaData activeMetaData = getActiveMetaData();
// Start of dataset
if (activeMetaData == null && qName.equals(DATASET)) {
_consumer.startDataSet();
_orderedTableNameMap = new OrderedTableNameMap(_caseSensitiveTableNames);
// SLAN register tables in the metadataset order
if (_metaDataSet != null) {
for (String tableName : _metaDataSet.getTableNames()) {
_consumer.startTable(_metaDataSet.getTableMetaData(tableName));
_consumer.endTable();
}
}
return;
}
// New table
if (isNewTable(qName)) {
// If not first table, notify end of previous table to consumer
if (activeMetaData != null) {
_consumer.endTable();
}
// In FlatXML the table might have appeared before already, so
// check for this
if (_orderedTableNameMap.containsTable(qName)) {
activeMetaData = (ITableMetaData) _orderedTableNameMap.get(qName);
_orderedTableNameMap.setLastTable(qName);
} else {
activeMetaData = createTableMetaData(qName, attributes);
_orderedTableNameMap.add(activeMetaData.getTableName(), activeMetaData);
}
// Notify start of new table to consumer
_consumer.startTable(activeMetaData);
_lineNumber = 0;
}
// Row notification
if (attributes.getLength() > 0) {
// If we do not have a _metaDataSet or DTD
if (_metaDataSet == null && (_dtdHandler == null || !_dtdHandler.isDtdPresent())) {
handleMissingColumns(attributes);
// Since a new MetaData object was created assign it to the
// local variable
activeMetaData = getActiveMetaData();
}
_lineNumber++;
_lineNumberGlobal++;
Column[] columns = activeMetaData.getColumns();
Object[] rowValues = new Object[columns.length];
for (int i = 0; i < columns.length; i++) {
Column column = columns[i];
rowValues[i] = getAttributeValueFromCache(attributes.getValue(column.getColumnName()));
}