Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: .NET security update broke transform engine? >Thread Next - Re: .NET security update broke transform engine? Re: .NET security update broke transform engine?To: NULL Date: 7/14/2007 4:22:00 PM
APA wrote:
> I didn't say I was using the XslTransform class, I was generically
> referring to the XslTransform engine in .NET (and this is a .NET 2.0
> application). The issue is clearly a problem with the update as my
> server that does not have the update doesn't produce the bad output but
> the one with it does.
>
> Here's a real simple example that produces the bad output.
>
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method="html" omit-xml-declaration="no"
> encoding="ISO-8859-1" />
>
> <xsl:template match="/">
> <b> </b>
> </xsl:template>
>
> </xsl:stylesheet>
>
>
> This generates character xFFFD in the output where it produced a proper
> space character previously.
I have a Windows XP system here that on Wednesday got the security
update for KB928365. Using your stylesheet I made the following complete
test case
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Xml;
using System.Xml.Xsl;
namespace ConsoleApplication106
{
class Program
{
static void Main(string[] args)
{
XslCompiledTransform xsltProcessor = new
XslCompiledTransform();
xsltProcessor.Load(XmlReader.Create(new
StringReader(@"<xsl:stylesheet
xmlns:xsl=""http://www.w3.org/1999/XSL/Transform"" version=""1.0"">
<xsl:output method=""html"" indent=""no"" encoding=""ISO-8859-1""/>
<xsl:template match=""/""><b> </b></xsl:template>
</xsl:stylesheet>")));
MemoryStream memStream = new MemoryStream();
xsltProcessor.Transform(XmlReader.Create(new
StringReader(@"<dummy/>")), null, memStream);
memStream.Position = 0;
StreamReader streamReader = new StreamReader(memStream,
xsltProcessor.OutputSettings.Encoding);
string contents = streamReader.ReadToEnd();
streamReader.Close();
foreach (char c in contents)
{
Console.WriteLine("Character '{0}' with codepoint
{1}.", c, (int)c);
}
}
}
}
The output on the console is
Character '<' with codepoint 60.
Character 'b' with codepoint 98.
Character '>' with codepoint 62.
Character ' ' with codepoint 160.
Character '<' with codepoint 60.
Character '/' with codepoint 47.
Character 'b' with codepoint 98.
Character '>' with codepoint 62.
so the non-breaking space (character 160) is correctly included in the
output.
I can't reproduce the problem you describe.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
