I'm trying to write a XSLT to produce a Spreadsheet ML to be further read by Excel and run into a problem with newlines. I need to add a newline to cell data. I made a sample in Excel to check the Excel idea of newline and got the following:
<Data>abc def</Data>
Here the
reference is a newline and Excel understands it just fine when it reads the file back. I try to produce the same with XSLT, but, naturally, I get a true 0x0A (LF) character instead, so my XML looks so:
<Data>abc
def</Data
This doesn't seem to agree with Excel way to represent newlines and when I open the file in Excel I get no newline.
I tried to research the problem, but got nothing except the following short discussion which doesn't really give a solution and suggests it may be a bug in Excel. (UPDATE: As far as I understand this is what the specs call "accidents of encoding" and an XML parser must not rely on them, while Excel does.)
Is there a way to work around this somehow and get a literal
in output instead of the LF character? Or maybe solve this in another way?