in backend/app/extraction/tables/ExcelTableExtractor.scala [80:103]
private def getDataRow(xmlReader: XMLStreamReader, stringsTable: ReadOnlySharedStringsTable, sheetName: String, stylesTable: StylesTable): Option[TableRow] = {
var rowValues: List[String] = List.empty
var cellReference: CellReference = null
breakable {
while (xmlReader.hasNext) {
xmlReader.next
if (xmlReader.isStartElement) {
if (xmlReader.getLocalName.equals("c")) {
cellReference = new CellReference(xmlReader.getAttributeValue(null, "r"))
// Fill in the possible blank cells!
while (rowValues.size < cellReference.getCol) { rowValues :+= "" }
val cellType = xmlReader.getAttributeValue(null, "t")
val cellStyleStr = xmlReader.getAttributeValue(null, "s")
val cellValue = getCellValue(cellType, xmlReader, stringsTable, stylesTable, cellStyleStr)
rowValues :+= cellValue
}
}
if (xmlReader.isEndElement && xmlReader.getLocalName.equals("row")) break()
}
}
if (cellReference != null)
Some(TableRow(Some(sheetName), cellReference.getRow, rowValues.zipWithIndex.map{ case (cell, index) => index.toString -> cell }.toMap))
else None
}