I use the handler ($$) prototype for my Handlers so that i can cast my apache handlers into proper perl objects that i can attach things to and call methods on:
package Foo;
sub handler ($$) {
my $self = shift; # contains package name Foo
my $r = shift; # contains APACHE request object
$self = $self->new unless ref $self;
...
}
sub new {bless{},shift};What appears to happen is that the first time an XSL file does an <xsl:include> call to slurp in a subservient file, the handler prototype behavior gets broken and from then on every call to handler is executed as if there was no ($$) prototype, i.e. $self now contains the APACHE request object and $r is undefined. Aside from breaking the script, there is no way to recover because even if i check for $self being the request object, i cannot determine what package i'm in to bless myself.
I've reproduced this in 1.60 and 1.61 on apache 1.3.27 and apache 1.3.28 using libsxlt 1.0.27 and 1.0.21. It occurs regardless of whether the stylesheet that has the include is hardcoded in the XML or attached via a StyleProcessor.
I thought it might be because of Apache Subrequests, but when i write my own handlers that do a couple of nested subrequests, all is fine.. Only when LibXSLT (or the part of AxKit that calls it) does the same thing, do the handler prototypes break. If someone else has any suggestions on how to further isolate this behavior.
My only recourse right now is to use the __PACKAGE__ global to restore the lost information, which means handler can never be inherited by a subclass.
thanks, arne
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
