[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] how to pass a paramter to xsl in a simple way?


Subject: [xsl] how to pass a paramter to xsl in a simple way?
From: "Hubert Holtz" <Turnhose_alt@xxxxxxx>
Date: Sun, 26 Jan 2003 21:26:00 +0100

Hello,

I read some articles about passing parameters to xsl in the archive of this list, but couldn't find a simple solution for the following problem.

I have xsp documents with a xml structure for two languages, so the same structure twice in one xsp document, and depending on
the value of the "lang" request parameter of the url it generates this structure in the one language or the other:

I used this:

<xsp:logic>
		if (<xsp-request:get-parameter name="lang"/>.equals("1")){

So that's working fine. My XSL generates an html document, but the problem is, that it has to write different html-code, depending on the language.
This code is something like "Here is your list of countries", or for the other language "Hier ein Liste der Länder".
So depending on the language parameter the html code (here just simple text but this is only an example) has to be different.

The best way to solve this would be something like that (in my eyes)

<xsl:if test="lang&eq;'1'">  <!-- don't know if &eq; stands for = but that's not the problem -->
			<tr>
				<td width="610" height="5" colspan="3"><img width="1" height="1" src="fake.kill/img/pixel.gif"/></td>
			</tr>
</xsl:if>

But how can i pass the paramter from the url to the xsl in a simple way?
Or if there is a complex solution ( read something about creating different kinds of XSL files depending on thta paremter, but it wasn't written how), please give me a detailed description.

Thanks.

Homer30 


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



Current Thread
Keywords