Mailing List Archive

Script_OnParse
Hello,



I was reading through the source for GlobalASA.pm and saw Script_OnParse in
there as an event.

After a quick google, I really didn't find much - just a couple mentions on
this mailing list.



Script_OnParse doesn't seem to be passed any arguments. Would it be
possible to have a Script_OnBeforeParse event in the Global.asa?



Reason being, it would be great to be able to apply source filters on the
ASP code, or XSLT transformations before it's converted into perl.



Thanks!

John Drago
Re: Script_OnParse [ In reply to ]
John Drago wrote:
> Hello,
>
>
>
> I was reading through the source for GlobalASA.pm and saw Script_OnParse
> in there as an event.
>
> After a quick google, I really didn’t find much – just a couple mentions
> on this mailing list.
>
>
>
> Script_OnParse doesn’t seem to be passed any arguments. Would it be
> possible to have a Script_OnBeforeParse event in the Global.asa?
>
>
>
> Reason being, it would be great to be able to apply source filters on
> the ASP code, or XSLT transformations before it’s converted into perl.
>
>

Hi John,

I'm impressed that you found it, and I'm surprised that it had to be found,
that it was never documented.

The whole point of Script_OnParse is to be able to apply a source filter
on the ASP code. The code is available as a scalar ref as:

sub Script_OnParse {
my $code = $Server->{ScriptRef}
$$code .= " ADDED SOMETHING ";
}

The script in $code is then processed as normal, and then turned into
parsed into perl code for compilation.

Regards,

Josh

________________________________________________________________________
Josh Chamas, Founder | NodeWorks - http://www.nodeworks.com
Chamas Enterprises Inc. | NodeWorks Directory - http://dir.nodeworks.com
http://www.chamas.com | Apache::ASP - http://www.apache-asp.org


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org