I have a transformation to HTML (xhtml), declared
<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="2.0"
<xsl:output method="xhtml" encoding="UTF-8" omit-xml-declaration="yes" indent="no"/>
I am getting different encoding of the entities on serialization. When I output formatted text using the following code (where $converted-value is: Jul 28, 2015 03:13:15 p.m. EDT
), some times the
is encoded, and other time it is not.
<span style="white-space:pre;">
Jan 05, 2016 05:00:44 p.m. EST
</span>
The difference is seen when executing in Oxygen and a Java program. From Oxygen, the entities are always output as
, but in other cases (inconsistently) the output is encoded: &nbsp;
as follows.
<span style="white-space:pre;">
Jan 05, 2016 05:00:44 p.m. EST
</span>
or
<span style="white-space:pre;">
Jul&nbsp;28,&nbsp;2015&nbsp;&nbsp;&nbsp;03:13:15&nbsp;p.m.&nbsp;EDT
</span>
This behavior is inconsistent on the same machine, and on others. What controls this behavior? It seems that disable-output-escaping
doesn't always work. How can I code so that the output is predictable?
Thanks!