This is the correct version as Robin explained in his reply:

All params are read are stored into a "global" variable and you can
access it within the complete xsl.

--------------------8<--------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<!-- ######################## -->
<!-- param goes here -->
<!-- ######################## -->
<xsl:param name="param" />
<xsl:output method="html" indent="yes" encoding="ISO-8859-1"/>


<xsl:template match="doc">
        <html>
                <head>
                        <title><xsl:value-of select="title"/></title>
                </head>
                <body>
                        <!-- ######################## -->
                        <!-- read from variable -->
                        <!-- ######################## -->
                        <h2>param is set to:<xsl:value-of select="$param"/></h2>
                        <xsl:apply-templates/>
                </body>
                </html>
</xsl:template>

<!-- templates here -->

<xsl:template match="para">
        <p>
                <xsl:apply-templates/>
        </p>
</xsl:template>

<xsl:template match="link">
        <a href="/linkage/[EMAIL PROTECTED]">
                <xsl:apply-templates/>
        </a>
</xsl:template>

<xsl:template match="title">
        <h1><xsl:value-of select="."/></h1>
</xsl:template>

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

On Wed, 2003-10-08 at 13:08, Alex Greg wrote:
> Thomas Schindl wrote:
> 
> >Hi,
> >
> >you can read query variables simply using <xsl:param
> >name="my-cgi-param"/>
> >
> 
> First off, thanks very much for your reply
> 
> I've put
> 
> AxAddPlugin Apache::AxKit::Plugin::QueryStringCache
> 
> into httpd.conf and restart Apache.
> 
> Next I tried creating a simple example:
> 
> style.xsl:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> <xsl:output method="html" indent="yes" encoding="ISO-8859-1"/>
> 
> 
> <xsl:template match="doc">
>         <html>
>                 <head>
>                         <title><xsl:value-of select="title"/></title>
>                 </head>
>                 <body>
>                         <h2>param is set to: <xsl:param name="param" /></h2>
>                         <xsl:apply-templates/>
>                 </body>
>                 </html>
> </xsl:template>
> 
> <!-- templates here -->
> 
> <xsl:template match="para">
>         <p>
>                 <xsl:apply-templates/>
>         </p>
> </xsl:template>
> 
> <xsl:template match="link">
>         <a href="/linkage/[EMAIL PROTECTED]">
>                 <xsl:apply-templates/>
>         </a>
> </xsl:template>
> 
> <xsl:template match="title">
>         <h1><xsl:value-of select="."/></h1>
> </xsl:template>
> 
> </xsl:stylesheet>
> 
> 
> and transformed it via AxKit with a simple XML document, requesting it 
> in my browser as:
> 
> http://localhost/query_param_test/doc.xml?param=test123
> 
> Unfortunately the parameter was empty in the resulting HTML page:
> 
> 
> "param is set to: "
> 
> 
> Any ideas what could be wrong?
> 
> 
> Alex
> 
> >When you have caching turned on please ensure that you use 
> >AxAddPlugin Apache::AxKit::Plugin::QueryStringCache, because "normal"
> >caching does not uses the query-string.
> >
> >Tom
> >
> >  
> >
-- 
   \\\||///
  \\  - -  //
   (  @ @  )
-oOo--( )--oOo----------------------------------------------------------
                     ___  ___                                tom schindl
      o       __    /  / /           innovative medientechnik planung AG
     / /\/\/ / /   /__/ / __            mailto:[EMAIL PROTECTED]
    / / / / /_/   /  / /___/                        http://www.impire.de
           /                 voice:+43(512)34193432,fax:+43(512)34193420
   Eduard-Bodem-Gasse 6, A-6020 Innsbruck, Austria, Software Engineering
------------------------------------------------------------------------


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

Reply via email to