Hi David,

I think you should subclass org.dom4j.io.XMLWriter and override the escapeElementEntities(String text) method to not escape the <> characters and to convert your '\n' to the appropriate &#xxx
Take a look at the current implementation of that method:
http://www.dom4j.org/xref/org/dom4j/io/XMLWriter.html#1359


regards,
Maarten

David Thielen wrote:

Hi;

Ok, this is a very weird request. And I know it violates how xml is supposed to work. But it’s a requirement of the SpreadsheetML format that Microsoft is using.

This format has:

<Data>blah blah blah</Data>

Where blah blah blah is the contents of a cell in the spreadsheet. Here is the weirdness. Let’s say all of the text is bold. Then the xml is:

<Data><B>blah blah blah</B></Data>

But if it is written as:

<Data>

<B>blah blah blah</B>

</Data>

Then the cell contents are “ \n<B>blah blah blah</B>\n “

How can I write this using dom4j? I figure I can create a separate rendering of the cell text – but I then have to be able to write it where the <> does not get converted to &lt;&gt;.

Again, I did not design this – Microsoft did. I just have to live with it.

??? – thanks - dave





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to