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]

Reply via email to