I did indeed cut and paste from your Man page, without it I wouldn�t of got
anywhere. However in doing so I made a stupid mistake and forgot to add to
my taglib;

use Apache::AxKit::Language::XSP;
@ISA = qw(Apache::AxKit::Language::XSP Exporter);

I should of spotted the error earlier myself, apologies, but the help I got
was great.


> 
> On Fri, 22 Feb 2002, Mark Cance wrote:
> 
>> When I try and view the page (taglib.xml), I get the following error in my
>> error_log;
>> 
>> [Fri Feb 22 11:12:49 2002] [notice] Apache/1.3.23 (Unix) AxKit/1.5
>> mod_perl/1.26 configured -- resuming normal operations
>> [Fri Feb 22 11:12:49 2002] [notice] Accept mutex: fcntl (Default: fcntl)
>> [Fri Feb 22 11:12:57 2002] [error] [client 192.168.11.3] [AxKit] [Error]
>> Can't locate object method "register" via package "freeloader::taglib
>> " (perhaps you forgot to load "freeloader::taglib"?) at
>> /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/Apache/AxKit/Language/XSP.
>> pm line 15
>> 3.
> 
> You didn't set @INC in your taglib.
> 
> Really, did you read the TaglibHelper man page? It gives a cut-and-paste
> example of what you would stick at the top of your file.
> 
>> 
>> Obviously I've got some more reading to do on the mod_perl front!! But I
>> assumed my taglib below was complete.
>> 
>> 
>> 
>> -------------------------------taglib.pm
>> #
>> ########################################################################
>> #test-taglib
>> #
>> ########################################################################
>> #001
>> 
>> package freeloader::taglib;
>> 
>> $NS = 'http://www.mytest.com/xsp/taglib/';
>> @EXPORT_TAGLIB = (
>> 'hello()'
>> );
>> 
>> use Apache::AxKit::Language::XSP::TaglibHelper;
>> sub parse_char { Apache::AxKit::Language::XSP::TaglibHelper::parse_char(@_);
>> }
>> sub parse_start {
>> Apache::AxKit::Language::XSP::TaglibHelper::parse_start(@_); }
>> sub parse_end { Apache::AxKit::Language::XSP::TaglibHelper::parse_end(@_); }
>> use strict;
>> 
>> 
>> sub hello() {
>>     return "hello world!";
>> }
>> 
>> 
>> 
>>> On 02/21/02 08:02 AM, "Mark Cance" <[EMAIL PROTECTED]> wrote:
>>>> I'm trying to knock together a taglib with AxKit::TaglibHelper, but there's
>>>> a couple of things I'm real unsure on.
>>> 
>>>> My main question is how do I reference the taglib from within my XML. If I
>>>> remember from my limited knowledge of Cocoon a taglib is referenced by -
>>>> <?xml-logicsheet href="http://www.mysite.com/mytaglib.xsl";?> I tried this
>>>> with AxKit without any joy.
>>> 
>>> The "$NS" variable must be set to the same value that you want to use as the
>>> URL in your namespace declaration.  For example, in your taglib Perl Module
>>> set:
>>> 
>>> $NS = "http://mysite.com/my/taglib";;
>>> 
>>> Then, in your XSP page, you must reference that taglib with a namespace in
>>> the "xsp:page" tag.  For example,
>>> 
>>> <?xml version="1.0"?>
>>> <xsp:page 
>>>   xmlns:xsp="http://www.apache.org/1999/XSP/Core";
>>>   xmlns:mylib="http://mysite.com/my/taglib";
>>>   language="Perl">
>>>   <page>
>>>       <!-- this would call the function "my_function" in your new taglib
>>>       <mylib:my_function key='alpha' />
>>>   </page>
>>> </xsp:page>
>>> 
>>> Again, just make certain that the "$NS" variable in your .PM file matches
>>> the "xmlns" namespace value in your "<xsp:page>" tag.
>>> 
>>>> My other question, (and probably the root of my problem), is what do I call
>>>> the taglib in terms of type, (.xsl or .pm?), if its .pm I assume it has to
>>>> be within a directory on my @INC path and referenced by the XML in a
>>>> different way than I give above?
>>> 
>>> Yes, the .PM file must be included in your @INC Path.  Just include a
>>> section at the top of your httpd.conf for your mod_perl server:
>>> <perl>
>>>   use lib "/my/new/lib/path";
>>> </perl>
>>> 
>>> Finally, make sure you don't forget to include the "AxAddXSPTaglib"
>>> directive in your "httpd.conf".  Without loading the taglib into AxKit there
>>> is no way that the value of "$NS" can be looked up and the taglib can be
>>> matched to the XSP page.
>>> 
>>> Good Luck-
>>> 
>>> -R
>>> 
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to