[thelist] OT? Google Mini XSL question

Brent Eades beades at almonte.com
Fri Jul 28 13:12:06 CDT 2006


Hope this isn't too far off topic... anyway, I'm trying to set up Google 
Mini so that the XSL stylesheet serves up labels, collection choices, 
etc, in English or French, depending on which language is specified by 
'restrict'.

I got off to a good start:

<xsl:variable name="search_subcollections_xslt">
<xsl:choose>
   <xsl:when test="PARAM[(@name='restrict') and (@value='English')]">
     <option value="English" selected="selected">English</option>
   </xsl:when>
   <xsl:when test="PARAM[(@name='restrict') and (@value='French')]">
     <option value="French" selected="selected">French</option>
   </xsl:when>
   [snip]
</xsl:choose>
</xsl:variable>

This works as expected: when you start on my French search page, which 
contains <input type="hidden" name="restrict" value="French">, the 
results pages show only 'All documents' and 'French' as the collection 
choices. Vise-versa for English.

But this next bit doesn't work, and I can't understand why not:

<xsl:variable name="choose_search_button">text</xsl:variable>
<xsl:variable name="search_button_text">
<xsl:choose>
   <xsl:when test="PARAM[(@name='restrict') and (@value='English')]">
    Search
   </xsl:when>
   <xsl:when test="PARAM[(@name='restrict') and (@value='French')]">
   Recherche
   </xsl:when>
   [snip]
</xsl:choose>
</xsl:variable>

I can see that the 'restrict' paramater is correctly passing either 
'English' or 'French' as its value, e.g.

search?q=test&restrict=French&etc

...but the value of 'search_button_text' stubbornly remains at 'Foo'.

It seems to me these two examples should work exactly the same... what 
am I missing?


-- 
Brent Eades	
Almonte, Ontario
http://almonte.com




More information about the thelist mailing list