xsl-list
[Top] [All Lists]

Re: [xsl] Need help with using lookup table and string translation

2009-05-11 09:57:42
You need a template that matches all <trs> elements
In that template select the text node and store the text value in a variable. 
lets call it $key
then select /trans/tr_string[(_at_)str=$key]/ru/text()
if it isnot empty return it otherwise select the en version.
this can be done with a if then else expression

I'd be tempted to do

<xsl:key name="tr_string-by-str" match="tr_string" use="@str"/>

with something like:

for $x in key('tr_string-by-str', $key) return (x$/ru, $x/en, .)[1]




-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--