private def getCellValue()

in backend/app/extraction/tables/ExcelTableExtractor.scala [105:134]


  private def getCellValue(cellType: String, xmlReader: XMLStreamReader, stringsTable: ReadOnlySharedStringsTable, stylesTable: StylesTable, cellStyleStr: String): String = {
    var value = "" // by default
    breakable {
      while (xmlReader.hasNext) {
        xmlReader.next
        if (xmlReader.isStartElement) {
          if (xmlReader.getLocalName.equals("v")) {
            if (cellType != null && cellType == "s") {
              val idx = xmlReader.getElementText.toInt
              value = stringsTable.getItemAt(idx).getString
            } else {
              // Get the style of the cell in order to determine whether is a date
              val style = getStyle(cellStyleStr, stylesTable)
              val formatIndex = style.getDataFormat
              val formatString = style.getDataFormatString

              if(DateUtil.isADateFormat(formatIndex, formatString)) {
                val textElement = xmlReader.getElementText
                val date = textElement.toDoubleOption.flatMap(double => Option(DateUtil.getJavaDate(double)))
                value = date.getOrElse(DateUtil.getJavaDate(0)).toString
              } else value = xmlReader.getElementText
            }
          }
        }

        if (xmlReader.isEndElement && xmlReader.getLocalName.equals("c")) break()
      }
    }
    value
  }