Hey,

I am considering long belated compile time extensions
that would allow at least partial handling of other languages
formats like Cold Fusion, XSP, Embperl, ... a developer would 
be able to rewrite a template at compile time into ASP.

Here's what I have in mind:

PerlSetVar TagParseMatch ^xsp:   
## for XSP conversion of <xsp:logic>...</xsp:logic>
# global.asa
sub Script_OnTagParse {
   my($tag, $begin, $args) = @_;
   if($tag eq 'xsp:logic') {
      my $replace = $begin ? '<%' : '%>';      
   } ...
}

PerlSetVar TokenParseMatch [+,+],[*,*]   
## for Embperl conversion of [* *] type constructs
# global.asa
sub Script_OnTokenParse {
   my $token = shift;
   if($token eq '[*') {
      '<%';
   } elsif($token eq '*]') {
      '%>';
   } ...
}

The results would then be inserted into the parse stream
for ASP before other language parsing is done.
Once compiled, there would be no extra overhead to 
running the code, unlike with XMLSubsMatch.  XMLSubsMatch
will continue to be the only way to handle the text 
contained within a tag like <tag> text </tag>.

So what do you think?  Will anyone use this?

-- Josh

Reply via email to