W3C home > Mailing lists > Public > www-html@w3.org > February 2006

Re: hreflang

From: Laurens Holst <lholst@students.cs.uu.nl>
Date: Tue, 07 Feb 2006 03:02:38 +0100
Message-ID: <43E7FFBE.4000008@students.cs.uu.nl>
To: Oskar Welzl <lists@welzl.info>
Cc: www-html@w3.org

Oskar Welzl schreef:
>> [hreflang="nl"],
>> [hreflang^="nl-"],
>> [hreflang^="nl;"],
>> [hreflang^="nl,"],
>> [hreflang*=",nl-"],
>> [hreflang*=",nl;"],
>> [hreflang*=",nl,"],
>> [hreflang$=",nl"] {
>>     background-image: url('dutch_flag.png');
>> }
>>     
>
> Wow! Can't wait to see this beauty in the wild. (Although I have no idea
> if it does what it should - I simply trust you.)
>   

Ehehehe :).

Can’t wait either ;p.

> Could you skillfully apply the same ruthless cruelty to XSLT?
> Please? ;-)
>   

Hmm, something like:

<xsl:variable name="something">
   <xsl:for-each select="tokenize(@hreflang,',')">
      <xsl:if test="tokenize(tokenize(.,';')[1],'-')[1] = 'nl'">
         <xsl:value-of select="." />
      </xsl:if>
   </xsl:for-each>
</xsl:variable>
<xsl:if b:test="|not(empty(|$something))">
   <img src="dutch_flag.png" alt="Dutch flag" />
</xsl:if>

But XSLT isn’t really exciting in this case (although it could be 
reasonably cool if XPath had a map() function of some sorts, I could 
make a nice one-liner).


~Grauw

-- 
Ushiko-san! Kimi wa doushite, Ushiko-san!!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Laurens Holst, student, university of Utrecht, the Netherlands.
Website: www.grauw.nl. Backbase employee; www.backbase.com.
Received on Tuesday, 7 February 2006 02:04:41 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:16:05 GMT