Forum Moderators: open

Message Too Old, No Replies

dyanmic creation of static html files

from an xsl output... too much fun :)

         

macrost

2:29 am on Jan 25, 2004 (gmt 0)

10+ Year Member



Hey,
It's been a while since I've hung out, but here's a good one.
I'm trying to save the final output of an xsl stylesheet as an html file for more se pages. Now the file is being written, but the actual xsl output isn't. Here's a snippet:

writehtml = processor.output
Set filesys = CreateObject("Scripting.FileSystemObject")
set fname = filesys.OpenTextFile("e:/html/domains/adsf.com/wwwroot/home_decor/" & Replace(Request.Form("keywords"), " ", "_") &".html", 2,true)
fname.WriteLine(writehtml)

Any thoughts?
I'm not getting an error whatsoever.
Thanks,
Mac

f00sion

6:09 am on Jan 25, 2004 (gmt 0)

10+ Year Member



does it work without all that fancy stuff when naming the output file?..like if you just tried test.html?

macrost

6:31 am on Jan 25, 2004 (gmt 0)

10+ Year Member



Ok, well I figured it out. f00sion thanks for replying to me! Here's the finished code:

writehtml = processor.output
Set filesys = CreateObject("Scripting.FileSystemObject")
set fname = filesys.OpenTextFile("e:/html/domains/asdf.com/wwwroot/search/" & Replace(Request.Form("keywords"), " ", "_") &".html",2,true)
fname.WriteLine(writehtml)
Response.write(writehtml)
fname.Close

The funny thing is, once you call processor.output, then everything that is in there is gone from memory. Doing it this way keeps everything where you want it. ;)

Mac