Formatting substrings in SpreadsheetML cells using Xelem

170 Views Asked by At

When looking for a Java library which can produce (and read) SpreadsheetML 2003 files, I came across the Xelem library.

It almost perfectly fits all my needs; however, it does not seem to provide the possibility to format parts of strings in cells individually. I.e. I need to be able to write some words in cells in bold text while others are not bold, which is why I cannot use styles (as they format the whole cell uniformly):

"non-bold-text and bold-text"

When creating and saving files containing such cells with Excel, Excel uses bold tags of the HTML namespace like this:

...
<Cell><ss:Data ss:Type="String" xmlns="http://www.w3.org/TR/REC-html40">non-bold-text and <B>bold-text</B></ss:Data></Cell>
...

However, I cannot find any possibility to get Xelem to generate such code. It does not seem to offer the ability to specify additional namespaces for a cell.

Am I missing something here, and if not, is there a (simple) workaround for this?

Hints for alternative libraries are also appreciated, but the file format needs to be SpreadsheetML 2003.

0

There are 0 best solutions below