Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Caching / April 2006

Tip: Looking for answers? Try searching our database.

XSLT Caching

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Floris van Haaster - 10 Apr 2006 16:12 GMT
Hi all,

What I have:

I have a website and in the code I generate a xml document.
I also have a couple of xsl files and then I use the following lines to
generate the website from the xml and xsl:

xslTran.Load(serv.MapPath("default.xsl"))
xslTran.Transform(xmldoc, Nothing, Response.Output(), New XmlUrlResolver)
But now what i want to do is cache the default.xsl so the application
doesn't have to read the file @ avery request.

Does anybody know how to do this?

Thanks in advance!

Floris
Egil Hogholt - 14 Apr 2006 19:48 GMT
You can store the parsed xsl in the ASP.NET cache and make the cached
XslTransform object depend on the file so it is automatically removed from
the cache if the file is updated.

Something like this should work:

XslTransform xslTran = (XslTransform) Cache[fileName];
if (null == xslTran)
{
  xslTran = new XslTransform();
  xslTran.Load(fileName);
  Caching.CacheDependency fileDependency = new
Caching.CacheDependency(fileName);
  Cache.Insert(fileName, xslTran, fileDependency);
}

Cheers,
Egil
http://www.egilh.com/

> Hi all,
>
[quoted text clipped - 14 lines]
>
> Floris

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.