Vaclav Barta wrote:
Hi,

I've tried experimenting with Apache::AxKit::StyleChooser::PathInfo to give my experimental AxKit site a few different styles - having pipelines like

    <AxMediaType screen>
        <AxStyleName "#default">
            AxAddProcessor text/xsl /german/style/frame.xsl
        </AxStyleName>
        <AxStyleName "1-">
            AxAddProcessor text/xsl /german/style/frame1.xsl
            AxAddProcessor text/xsl /german/style/link1.xsl
        </AxStyleName>
    </AxMediaType>

Where link1.xsl simply adds "/1-" to all the links in the page.

It works, except I'd like users to be able to switch between styles. I've been planning to add (during an XSLT transformation) an image in the shape of a close button, linking to the page in a style not displaying whatever the "close button" is supposed to close - but to construct the link, I need to know the URL of the page the stylesheet is transforming, and I cannot find any XSLT function which would give it to me... Is there some AxKit feature I should be using for this kind of thing?

Yes. I'd write an AxKit-Plugin which passes the request-uri to my file as parameter.

The plugin would look like the following:


---------------------8<--------------------- package Apache::AxKit::Plugin::PassRequestURI;

use strict;
use Apache::Constants qw(OK);

sub handler
{
    my $r  = shift;

    $r->pnotes( 'request-uri', $r->uri );

    return OK;
}

1;
---------------------8<---------------------

---------------------8<---------------------
<xsl:stylesheet ....>
<xsl:param name="request-uri" />

<xsl:template match="/">
The requested URI: <xsl:value-of select="$request-uri" />
</xsl:template>

</xsl:stylesheet ....>
---------------------8<---------------------

---------------------8<---------------------
...
AxAddPlugin Apache::AxKit::Plugin::PassRequestURI
...
---------------------8<---------------------

Tom


Bye Vasek




--------------------------------------------------------------------- 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