I am publishing a message with spaces (calculated using string.format) and trying to show in HTML as it is. But failing to do so.
Code:
final String format = "|%1$-35s|%2$-20s|%3$-30s|%4$-20s|\n";
str = String.format(format,currentInputTag,currentInputVal,currentOutTag,currentOutVal)
str.replaceAll(" ", " ");
String output(the way I want it to look like):
|Input tag |Value |Output tag |Value |
|FlightLegReportedUtcDatetime |2012-07-25T01:54:00 |ns3:EstOffGroundDateTime |2012-07-25T01:54:00 |
But I get:

HTML:
label|Input tag |Value |Output tag |Value |/label
label|FlightLegReportedUtcDatetime |2012-07-25T01:54:00 |ns3:EstOffGroundDateTime |2012-07-25T01:54:00 |/label
I am not sure, even though the number of spaces are correct I see the output as shown above. BTW removing <> to show the tags.
You can edit your code an wrap the output into
<pre></pre>this will bring valid html and (if not defined different) a fixed width font.