After an XSLT transformation I keep getting leading question marks that (seem to) have to do with character encoding, but I can't get rid of them. I have tried all different encodings, but it didn't help. I'm stuck with an in-memory xml source, as I serialize objects.This is my code (as short as possible to reproduce the problem)\[code\]var xd = new XmlDocument();xd.LoadXml(@"<?xml version=""1.0"" encoding=""utf-8""?><Test><AAA>AAA</AAA></Test>");var xslt = new System.Xml.Xsl.XslCompiledTransform();xslt.Load(Server.MapPath("/Transformations/Test.xslt"));using (var ms = new MemoryStream()){ xslt.Transform(xd, null, ms); ms.Position = 1; using (var sr = new StreamReader(ms, System.Text.Encoding.UTF8, true)) { string s = sr.ReadToEnd(); }}\[/code\]And this is the XSLT:\[code\]<?xml version="1.0" encoding="utf-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"> <xsl
utput method="text" indent="no"/> <xsl:template match="Test"> BBB<xsl:value-of select="AAA" />CCC </xsl:template></xsl:stylesheet>\[/code\]Produces:\[code\]??\r\n\t\tBBBAAACCC\r\n\t\[/code\]It's probably very simple, but I can't figure it out...Regards,Heras
