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 March 22nd, 2004, 11:35 AM
Chris_Gilbert Chris_Gilbert is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: London
Posts: 166 Chris_Gilbert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 2 h 32 m 5 sec
Reputation Power: 6
HTML with XML

I want to create static HTML pages from my Database after updating my website using ASP and a CMS. The idea behind this is that when I submit my new information using my CMS the ASP will put it into a DB and then somehow convert this info into a single html page. The reason behind this is so that the ASP is only run once and when I decide, and from then on the all requests to my page outputs an HTML file, hence a faster service.
My question is this, how do I do it? Does my info in the DB need to be in XML and then use XSLT to create an HTML page or is there a simpler way. Currently the info in my DB is not XML it's just bog standard information.

Thanks in advance

Chris

Reply With Quote
  #2  
Old March 22nd, 2004, 03:09 PM
MattSidesinger's Avatar
MattSidesinger MattSidesinger is offline
Java PHP Oracle Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: C-Bus OH-IO
Posts: 204 MattSidesinger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 26 sec
Reputation Power: 5
Send a message via AIM to MattSidesinger
Keep the information in the database as it is. Don't convert it to XML. If another application would ever need this data it would need to be able to parase the XML.

Extract the information from the database using VBScript and then create and XML document from that. You will need to come up with how you want your XML document to look. You could use a schema in case something else in the future would need to know the rules of how you laid out the data in this XML file.

Once you have the XML file, create a seperate XSL file and do the transformation.

Here is an example:
Code:
Dim xmlDoc, xslDoc, xslTemplate

Set xmlDoc = CreateObject("MSXML2.FreeThreadedDOMDocument")
xmlDoc.async=False

' here call database query
' use rs object to add information to the xmlDoc object

Set xslDoc = CreateObject("MSXML2.FreeThreadedDOMDocument")
xslDoc.async=False
xslDoc.load "your.xsl"

Set xslTemplate = CreateObject("MSXML2.XSLTemplate")
xslTemplate.stylesheet = xslDoc
Set proc = xslTemplate.createProcessor

proc.input = xmlDoc
proc.output = Response ' this what I normally do
' but in your case you want to write out to a static
' HTML file.
proc.transform

Last edited by MattSidesinger : March 22nd, 2004 at 03:16 PM.

Reply With Quote
  #3  
Old March 22nd, 2004, 03:15 PM
MattSidesinger's Avatar
MattSidesinger MattSidesinger is offline
Java PHP Oracle Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: C-Bus OH-IO
Posts: 204 MattSidesinger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 26 sec
Reputation Power: 5
Send a message via AIM to MattSidesinger
Instead of doing this in ASP ... you could make a standalone executable that is written in Visual Basic and then have have something kick off the process. Just use the XML libraries avaialable to VB. If you need to know which ones these are and can't figure it out yourself I can find out ... I just don't remember which ones off hand.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > HTML with XML


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 1 hosted by Hostway