I am trying to convert and XML document using XSL. I am not very familiar with how to convert XML to .NET, so I am using some sample code ...
XslCompiledTransform xslTransformer = new XslCompiledTransform();
xslTransformer.Load(Server.MapPath("Test.xslt"));
MemoryStream ms = new MemoryStream();
xslTransformer.Transform(Server.MapPath("Test.xml"), null, ms);
ms.Seek(0, SeekOrigin.Begin);
StreamReader sr = new StreamReader(ms);
string output = sr.ReadToEnd();
ms.Close();
Response.Write(output);
The problem I ran into is the following line ...
xslTransformer.Transform(Server.MapPath("Test.xml"), null, ms);
The compiler shows an error when passing to nullthe conversion method. When looking at the method signatures, Transformit looks like the parameter nullrepresents various conversion options. The Visual Studio IDE even shows what this value can be null. I also tried using DBNull.Value, but it also shows an error. Any idea what I am missing?
: , , . (1) , null , System.DBNull. (2) null System.DBNull, overload resolution failed because no accessible Transform can be called with these arguments.