Reputation: 6296
I need to save the result of the instance of XslCompiledTransform after the call of load method how can I do that?
Upvotes: 2
Views: 1054
Reputation: 243529
Just use System.Web.Caching
(it works OK outside of ASP.NET!):
http://www.hanselman.com/blog/UsingTheASPNETCacheOutsideOfASPNET.aspx
Upvotes: 1
Reputation: 18082
Save to Application scope variable:
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load("style.xsl");
Application["CompiledTransform"] = xslt;
use somewhere else later:
XslCompiledTransform xs = Application["CompiledTransform"] as XslCompiledTransform;
xs.Transform("input.xml", "output.xml");
Upvotes: 1