[thelist] [ASP] templating system woe's
Gary McPherson
genyus at ingenyus.net
Thu Aug 21 23:35:52 CDT 2003
> Anthony,
>
> Since I'm using FSO to extract the data as a string from already
> marked up files, this didn't work for me. Thanks though, I
> had no idea that you could execute response.write statements like
> that; very cool.
>
> Against my better judgement, I conceded to myself this
> afternoon and am currently using FSO to write the data to a
> temporary file associated with the users sessionid and then
> server.execute-ing that into the file after the template is
> applied... I don't like the idea of it, but it works fine. I'm
> stress testing it now.
>
> If anyone has a better idea, I'd LOVE to hear it.
>
> Thanks again,
> Stephen
Perhaps this idea, conceived in the post-all-nighter fogginess, will
fall over - but how about parsing the string you extract from the file
to conform to the two rules Anthony pointed out? Namely:
1.No "<%" or "%>" tags
2.No raw HTML.
First, you could apply some formatting rules to any text outside a "<%"
"%>" pair which as far as I can tell would just involve doubling any
quotes, replacing line breaks with vbcrlf and wrapping it all inside a
Response.Write(). Then peel away all the "<%" "%>" tags and you're done.
Is it just me or does that sound too simple?
Hope that helps, apologies if it doesn't.
Gary
More information about the thelist
mailing list