Has anyone run into a problem with the .NET XSLT engine not respecting your output encoding?
I have my XSL file like this:
and the XML it produces has the encoding set to UTF-16, which is not what I wanted, nor specified.
The code I'm using to do the transform (in C#) is:
Thanks in advance.
Chip H.
I have my XSL file like this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform">[/URL]
<xsl:output version="1.0" encoding="UTF-8"/>
<xsl:template match="/">
<ChipData>
<xsl:value-of select="Data1"/>
</ChipData>
</xsl:template>
</xsl:stylesheet>
The code I'm using to do the transform (in C#) is:
Code:
XmlDocument MyDoc = new XmlDocument();
MyDoc.LoadXml(MyValidXML);
XPathNavigator MyNav = MyDoc.CreateNavigator();
MyTransform = new XslTransform();
MyTransform.Load(XSLPath);
StringWriter sw = new StringWriter();
MyTransform.Transform(MyNav, null, sw);
ReturnXML = sw.ToString();
Thanks in advance.
Chip H.