On Friday 01 February 2002 00:20, you wrote: > After looking at some other taglibs source code it seems to me that the XSP > module itself could probably be enhanced via a few OO perl tricks so that > you could just subclass it to create a taglib in a fairly clean way. In > essence what it seems like to me is you want to maybe create a set of > handlers that do the "compile time" part of the XSP automagically (so you > just define methods like "parse_start_mytag($self,...)" and those just get > called at the appropriate times. Should be pretty easy with an AUTOLOAD > trick or maybe using some tieing tricks.
Now, what you are describing is what SimpleTaglib does. Look at the example again, the source code snippet is a complete working example. And as Matt already explained, XSP.pm is used via OO inheritance (more or less so). > > package AxKit::XSP::MySoapTaglib; > > use Apache::AxKit::Language::XSP::SimpleTaglib; > > $AxKit::XSP::MySoapTaglib::NS = 'http://my.host.com/MySoap'; > > > > package AxKit::XSP::MySoapTaglib::Handlers; > > > > sub endpoint__open : attrib(proxy) { > > my ($e, $tag, %attribs) = @_; > > # Initialize and declare stuff. The proxy attribute is: > > $attribs{'proxy'} return 'my $endpoint = "initialized to some value";' > > } > > > > sub endpoint { > > # Now take some action, if you want. This sub is needed, even if > > # it returns nothing (i.e., no action) > > return ""; > > } > > > > sub endpoint___call : childStruct($uri $method{$name @arg}) { > > # act on a call. all the parameters are available in > > # %_, which is structured as follows: > > # %_ = ( uri => 'foo', > > # method => { name => 'AMethodOfFoo', > > # arg => [ 'gaga', '...' ] } ) > > return 'warn("method called: ".$_{"method"}{"name"});'. > > 'warn("endpoint data: ".$endpoint);'; > > } -- CU Joerg PGP Public Key at http://ich.bin.kein.hoschi.de/~trouble/public_key.asc PGP Key fingerprint = D34F 57C4 99D8 8F16 E16E 7779 CDDC 41A4 4C48 6F94 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
