[xsl]pass a parameter from the URL using Javascript

Subject: [xsl]pass a parameter from the URL using Javascript
From: "Leonidas Kanellos" <leonidaskanellos@xxxxxxxxxxx>
Date: Wed, 02 Apr 2003 12:42:45 +0000
Hi,

Does anyone know how to pass a parameter from the URL?

I declare my parameter at the top of the xsl stylesheet, like that:
<xsl:param name="page_number" select=" 1 "/>
iI change the select value and i get the h2 that i want.

My xml file looks like that:

	<div class="section">
			<h2>Chris</h2>
			<p>text</p>
			<p>text</p>
		</div>
		<div class="section">
			<h2>
				<a href="http://www.mypage.com";>Leo</a>
			</h2>
		</div>
		<div class="section">
			<h2>George</h2>
			<p>text</p>
		</div>
		<div class="section">
			<h2>Alex</h2>
			<p>text</p>
			<p>text</p>
		</div>


In my xsl i have this template witch i pick-up the desired h2 each time:


<xsl:template match="//xhtml:div[@class='section'][position()=$page_number]/xhtml:h2/*">

<xsl:when test="//xhtml:div[@class='section'][position()=$page_number]">
</xsl:template>

I found something like:

<script>

var page_number = location.search.substr(1).split("?");

</script>


but no luck...


Cheers

Leo

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread