Hi all,
Help needed in the xsl transformation in c# while passing with arguments.
I am trying to transform an xml programtically (c#), while passing with two parameters using the
XsltArgumentList class.
My problem is in the transformed xml.
Even when I set in my XmlWriter the Encoding to UTF-8, or even when I set it null,
my output transformed xml is without the xml header encoding attribute:<?xml version="1.0" encoding="utf-8"?>
Wether I set the encoding to utf-8 or null, it does not have any effect on my output file.
My bits of code doing the transformation is:
XslTransform myTran = new XslTransform();
myTran.Load(xsl);
XsltArgumentList args = new XsltArgumentList();
args.AddParam("param1", "", param1);
args.AddParam("param2", "", param2);
XPathDocument xpathdocument = new XPathDocument(iFile);
XmlTextWriter xmlWriter = new XmlTextWriter(oFile, Encoding.UTF8);
// XmlTextWriter xmlWriter = new XmlTextWriter(oFile, null);
myTran.Transform(xpathdocument, args, xmlWriter);
xmlWriter.Close();
Please help me clear my mind on this!
Thanks in advance.