class Axlsx::SharedStringsTable

Serialization performance is affected by using this serialization method so if you do not need interoperability

The Shared String Table class is responsible for managing and serializing common strings in a workbook. While the ECMA-376 spec allows for both inline and shared strings it seems that at least some applications like iWorks Numbers and Google Docs require that the shared string table is populated in order to interoperate properly. As a developer, you should never need to directly work against this class. Simply set 'use_shared_strings' on the package or workbook to generate a package that uses the shared strings table instead of inline strings. it is recomended that you use the default inline string method of serialization.

Creates a new Shared Strings Table agains an array of cells


  • cells (Array)

    This is an array of all of the cells in the workbook

  • xml_space (Symbol) (defaults to: :preserve)

    The xml:space behavior for the shared string table.

The total number of strings in the workbook including duplicates Empty cells are treated as blank strings

Interate over all of the cells in the array. if our unique cells array does not contain a sharable cell, add the cell to our unique cells array and set the ssti attribute on the index of this cell in the shared strings table if a sharable cell already exists in our unique_cells array, set the ssti attribute of the cell and move on.

Serializes the object


  • str (String) (defaults to: '')

An array of unique cells. Multiple attributes of the cell are used in comparison each of these unique cells is parsed into the shared string table.

The total number of unique strings in the workbook.

The xml:space attribute

SharedStringsTable is referenced in 0 repositories