I have an XSLT file that I want to load and use to transform an XML file. I\'ve added the file to the same project as the code that uses it and put it in the \"Resources\" f
A co-worker has helped me find a solution. We added the resource via the properties of the project, so that I can access its content easily and used the following code.
using (var reader = new StringReader(Resources.OrderOverview)) {
using (XmlReader xmlReader = XmlReader.Create(reader)) {
myXslTransform.Load(xmlReader);
myXslTransform.Transform(fileName, arguments, xmlTextWriter);
}
}
This is very similar to what outcoldman suggested with the subtle difference that the resource is accessed differently.