This is the correct version as Robin explained in his reply:Hi,
All params are read are stored into a "global" variable and you can access it within the complete xsl.
--------------------8<--------------------
After my previous comments about getting this to work, it unfortunately seems to fail sporadically, with the following message in the ErrorLog and an Internal Server Error displayed in the browser (refreshing the page a few times seems to fix the problem for a while):
[Thu Oct 9 16:28:56 2003] [error] [client 10.10.50.11] [AxKit] [Backtrace] Apache::AxKit::Language::Sablot Function not found at /usr/lib/perl5/site_perl/5.6.1/Error.pm line 148
Error::throw('Apache::AxKit::Exception::Error', '-text', 'Apache::AxKit::Language::Sablot Function not found') called at /usr/lib/perl5/site_perl/5.6.1/i386-linux/AxKit.pm line 769
AxKit::process_request('AxKit::Apache=SCALAR(0x8393efc)', 'Apache::AxKit::Provider::File=HASH(0x8393fc8)', 'ARRAY(0x8390d18)', undef) called at /usr/lib/perl5/site_perl/5.6.1/i386-linux/AxKit.pm line 474
AxKit::run_axkit_engine('AxKit::Apache=SCALAR(0x8393efc)', 'Apache::AxKit::Provider::File=HASH(0x8393fc8)') called at /usr/lib/perl5/site_perl/5.6.1/i386-linux/AxKit.pm line 300
eval {...} called at /usr/lib/perl5/site_perl/5.6.1/i386-linux/AxKit.pm line 291
AxKit::main_handler('AxKit::Apache=SCALAR(0x8393efc)', 'Apache::AxKit::Provider::File=HASH(0x8393fc8)') called at /usr/lib/perl5/site_perl/5.6.1/i386-linux/AxKit.pm line 204
AxKit::fast_handler('AxKit::Apache=SCALAR(0x8393efc)') called at /dev/null line 0
eval {...} called at /dev/null line 0
Any ideas what could be causing this, and how to rectify it?
My XML document is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<doc>
<title>Document One Title</title>
<para>This is some text in the first paragraph, we're going to have a <link target="1.1">link off to something</link> here</para>
<para>The text continues in the second paragraph over here</para>
<para>This is the last paragraph in this document, and it's the third one</para>
</doc>
and the XSL is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="para" />
<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> <xsl:call-template name="title"/> <xsl:call-template name="toplevel"/> </body> </html> </xsl:template>
<!-- templates here -->
<xsl:template name="toplevel">
<xsl:for-each select="para">
<xsl:choose>
<xsl:when test="position()=$para">
<p>
<xsl:value-of select="."/>
</p>
</xsl:when>
<!-- <xsl:otherwise>
para not found!
</xsl:otherwise>
-->
</xsl:choose>
</xsl:for-each>
</xsl:template><xsl:template match="link">
<a href="/linkage/[EMAIL PROTECTED]">
<xsl:apply-templates/>
</a>
</xsl:template><xsl:template match="title" name="title">
<h1><xsl:value-of select="title"/></h1>
</xsl:template></xsl:stylesheet>
I am requesting the page as:
http://localhost/query_param_test/doc.xml?para=2
Regards,
Alex
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
