xsl-list
[Top] [All Lists]

RE: Is it possible to get " " in output rather than the encoded character?

2004-05-19 07:24:12
I've taken the XmlTextWriter out of the picture and am now accessing the
byte[] output stream directly.  I think what I'm seeing is a misbehaving
processor, but being new to this I'm not certain.  The XSL and XML files are
included below.  Here is the output of the processor with non-printable
bytes output in \xAA format:

Output when xsl:output encoding="iso-8859-1":
        <html>\x0Ahello_\xA0_world\x0A</html>

Output when xsl:output encoding="utf-8":
        \xEF\xBB\xBF<html>\x0Ahello_\xC2\xA0_world\x0A</html>

---------- test.xsl ----------
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">

<xsl:output method="html" version="1.0" encoding="iso-8859-1" indent="yes"/>

<xsl:template match="/">
<html>
hello_&#160;_world
</html>
</xsl:template>

</xsl:stylesheet>
------------------------------

---------- test.xml ----------
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<bookmarks>
</bookmarks>
------------------------------

Having access to the byte stream I can obviously translate non-printable
character to &#000; format, but I thought that the whole point of the
xsl:output encoding was so that this would be done automatically?  Have I
got any of this wrong?

Regards,

Steven