Good afternoon all,
I dont know why this is proving so difficult but I must be having one of those days!
I am trying to perform and XslCompiledTransform on
transformedDoc.Load(reader.ReadToEnd());
Load
reads from a path; you probably want transformedDoc.LoadXml(...)
. But in all honesty, you could just write the whole thing to a StringWriter
- more direct:
string output;
using(var writer = new StringWriter())
{
processor.Transform(xdoc.CreateNavigator(), null, writer);
output = writer.ToString();
}
Plus it will work for non-xml outputs (xslt is not obliged to output xml).