XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 5th, 2004, 05:16 PM
KayJayDK KayJayDK is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Denmark
Posts: 4 KayJayDK User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to KayJayDK
Tip: Cacheing XML and XLS

Being quite new to the world of XML I have been looking all over for guidance and tutorials.

I found a little trick that I have adapted to my ASP generated webpages that I'd like to share with you and also to find out if ppl here think that I'll gain something (speed/less server load) from it.

Instead of having the server load the XML and XLS for every page it's generating, it caches them in application variables which only need to be updated when the server has been reset or when the administrator makes a 'mypage.asp?refresh=true' (after updating the contents of the XML/XLS).

Code:
<%@ Language=VBScript %>
<%
dim xml
dim xsl
if isEmpty(Application("myXML")) or Request("refresh") = "true" then
	'Load from disk
	set xml = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.4.0")
	set xsl = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.4.0")
	xml.load Server.MapPath(".") & "\mydata.xml"
	xsl.load Server.MapPath(".") & "\mydata.xsl"
	Application.Lock
	set Application("myXML") = xml
	set Application("myXSL") = xsl
	Application.UnLock
else
	'Load from cache
	set xml = Application("myXML")
	set xsl = Application("myXSL")
end if

%>

<HTML>
<HEAD></HEAD>
<BODY>

<%Response.write xml.transformNode(xsl)%>

</BODY>
</HTML>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Tip: Cacheing XML and XLS


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT