Todd W <[EMAIL PROTECTED]> wrote: >Im working throught the axkit articles at perl.com > >When I point my browser to ANY uri that is prossed by AxKit, I get a >server 500 error and the following in error_log: > >[Sun Oct 20 23:20:23 2002] [error] [client 127.0.0.1] [AxKit] [Error] >Can't locate object method "register" via package "My::WeatherTaglib" >(perhaps you forgot to load "My::WeatherTaglib"?) at >/usr/lib/perl5/site_perl/5.6.1/i686-linux/Apache/AxKit/Language/XSP.pm >line 168. > heres the taglib from http://www.perl.com/pub/a/2002/04/16/axkit.html#My::WeatherTaglib
package My::WeatherTaglib; $NS = "http://slaysys.com/axkit_articles/weather/"; @EXPORT_TAGLIB = ( 'report($zip)' ); use strict; use Apache::AxKit::Language::XSP::TaglibHelper; use Geo::Weather; sub report { Geo::Weather->new->get_weather( @_ ) } 1; I chaged: "use Apache::AxKit::Language::XSP::TaglibHelper;" to "use base ('Apache::AxKit::Language::XSP::TaglibHelper');" and the server 500 errors went away (which makes sense). The final document still wasnt what it was supposed to be, so I commented out the two XSLT PIs and got a document that looks like this: <?xml version="1.0" encoding="UTF-8"?> <data> <title><a name="title"/>My weather report</title> <time>14:17:03</time> <weather>-1</weather> </data> Does anyone know where I can look next? Im sorry for soundin like a ditz but I like to get a few nudges as to where to go by someone else before I jump in to a new technology. The biggest thing I dont understand is why the example flat out isnt working. I mean, should I still be looking in axkit or does this look like a problem from Geo::Weather itself? Im not complaining Barrie! The same thing happened to me with the XML::SAX::Maxhines article that Kip wrote, but I learned alot more because the example didnt work than I wouldve if it did. AxKit looks pretty cool, Ive done sort of the same thing with a different project. Basically I have an apache handler that handles all .xml files in the virtual server's filesystem. The handler uses XML::SAX::Machines and builds a partially dynamic pipleline (puts some hard coded handlers and filters into an array, then pushes a handler based on the requested filename onto the array if it exsists, then some cleanup handlers and the writer). The instance resulting from the pipeline is used to create a dynamic template if need be or it just uses a static template if the layout is static. The template is formatted for use with HTML::Template::XPath, so Its pretty simle to get the content and layout merged. The only feature about my idea that I like better than AxKit is that dynamic data is automatically added to the requested doc instead of having to explicity declare a taglib. For instance, SOISNet::Util::UserInfo waits for the first tag in the document, forwards it on downstream, and then uses XML::Generator::DBI to automatically insert the users data (including personal info, shopping cart, permission level). This way the XML document author dosent have to think about putting a tag in the document like: <sois:userinfo /> because the pipeline does it automatically. Also, the layout author knows that when they say: <CONTENT_VAR NAME="/document/userdata/username" /> the username of the currently logged in user will get dumped into the document, because theres no way the users info will NOT be in the content doc. How do you go about getting the same behavior in AxKit? Would you have an XSLT stylesheet that automatically inserts (for instance) <sois:userinfo /> into the requested document before any other processing is applied to the document? TIA, Todd W. __________________________________________________________________ The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
