How to create a XML with a Specific Encoding using XSLT and XMLWRITER
问题 I am trying to apply a XSL style sheet on a source xml and write the output to a target xml file. The xsl removes the xml comments present inside the source xml. The target xml file has UTF-16 encoding in the header. But still i want the output xml to be utf-8 encoding. The code i used is XmlWriterSettings xwrSettings = new XmlWriterSettings(); **xwrSettings.Encoding = Encoding.UTF8;** XslCompiledTransform xslt = new XslCompiledTransform(); xslt.Load("sample.xsl"); StringBuilder sb = new