build a "dynamical" parameter

Subject: build a "dynamical" parameter
From: Michael Hoffmann <m-hoffmann@xxxxxx>
Date: Wed, 1 Nov 2000 09:55:40 -0400 (EST)
hi all...

i am really stuck at this..
what i have is 
.....
<xsl:variable name ="mystring" select="adress[child::*[translate(., $uc,
$lc) =translate($search_para_one, $uc, $lc)] or child::*[translate(.,
$uc, $lc) =translate($search_para_two, $uc, $lc)]]" />
....
this works perfect (many thanks to jeni again :-)  )

what i need is to replace the "or" with a variable, because i want to be
able  to 
have eihter the string "mystring" with "and" or with "or" in it.

so this means either i have to make sth like

<xsl:if test="$user_cmd=and">
<xsl:variable name ="mystring" select="CATALOG/CD[child::*[translate(.,
$uc, $lc) =translate($search_para_one, $uc, $lc)] and
child::*[translate(., $uc, $lc) =translate($search_para_two, $uc,
$lc)]]" />
......
</xsl:if>

<xsl:if test="$user_cmd=or">
<xsl:variable name ="mystring" select="CATALOG/CD[child::*[translate(.,
$uc, $lc) =translate($search_para_one, $uc, $lc)] or
child::*[translate(., $uc, $lc) =translate($search_para_two, $uc,
$lc)]]" />
......
</xsl:if>
			
so my question is :
can i make sth like
.........
<xsl:variable name ="mystring2" select="CATALOG/CD[child::*[translate(.,
$uc, $lc) =translate($search_para_one, $uc, $lc)] $user_cmd
child::*[translate(., $uc, $lc) =translate($search_para_two, $uc,
$lc)]]" />
.........
(the "user_cmd "is set either to "or" or "and" ) ????
any ideas ??? (i am sure there is a way... but i havnt found it...)

(it dont work this way, bacause i get a 
org.apache.xalan.xslt.XSLProcessorException: pattern =
'CATALOG/CD[child::*[translate(., $uc, $lc) =translate($search_para_one,
$uc, $lc)]     $user_cmd2 child::*[translate(., $uc, $lc)
=translate($search_para_two, $uc, $lc)]]'
Expected ], but found: $
error)

thanks for your help

michael




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


Current Thread