Create attributes for each cell in a column

Hi,

I’m creating a program to read LibraOffice spreadsheets. The problem I have is I need to be able to read each Element attributes to be able to extract the information. By default Calc adds the attribute for example: table:table {table:name “sheetname”}.

This is my starting point in my program, but I need to add attributes to each cell. I have only four columns and each column is in category, For example: pots, pans, dishes and cups.

So my, table:table-row’s each have four table:table-cell, these cells need the attribute according to their category. so how can I add these in LibraOffice Calc?

Thanks?..

LibreOffice is essentially a WYSIWYG editor and ODF is just a storage format. There is no functionality to directly or indirectly edit the source code of the document, as far as I know. When LibreOffice saves a document, it constructs a file from the document’s representation in memory, presumably as efficiently as possible. The file you get may differ significantly from the memory structure.

When you write a program to read a spreadsheet file, you do a similar thing – you reconstruct the table into memory. Presumably the first row you read contains column labels. After that, you can add those labels as attributes to cells in the consecutive rows if you want, or create some other kind of memory structure that suits your needs.

Another way to differentiate and categorize cells would be to create custom styles for them. This way the data table wouldn’t have to be ordered by column labels.

I know this question is a year old, but I thought it still deserved an answer.