|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
||||
|
||||
|
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.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > HTML with XML |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|