This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Key/Use
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Key/Use
- From: Kevin_Gutch at mapinfo dot com
- Date: Wed, 5 Sep 2001 14:53:36 -0400
- Reply-To: xsl-list at lists dot mulberrytech dot com
Yes. I guess that is what I will need to do. I just do not like hard-coding
it that way. Anytime I add country I will have to edit the file. Oh well.
I'll use it until I can get something better. I am still a little new.
David_Marston@lotus.com
Sent by: To: xsl-list@lists.mulberrytech.com
owner-xsl-list@lists.mulber cc:
rytech.com Subject: Re: [xsl] Key/Use
09/05/2001 02:31 PM
Please respond to xsl-list
The problem was originally described as:
><xsl:key name="lookup" match="row"
> use="concat($TRANSFORMER_SourceCountry,'_layer_name')"/>
where the variable specifies a country code. After some discussion,
it came down to:
>So I guess I can not have a dynamic lookup table?
Not that way, but you could define several keys, then dynamically
pick which key:
<xsl:key name="US_lookup" match="row" use="US_layer_name"/>
<xsl:key name="ES_lookup" match="row" use="ES_layer_name"/>
<xsl:key name="CN_lookup" match="row" use="CN_layer_name"/>
<xsl:key name="BG_lookup" match="row" use="BG_layer_name"/>
then
...select=key(concat($country,'_lookup'),$value)...
Hope that helps!
.................David Marston
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list