Jarrod Rathjen's Portfolio

IE Conditional Statements in XSLT

0

Web development

Wednesday, July 09, 2008

This is a simple bit of code that allows IE conditional Statements to be passed in XSLT. I had some difficultly getting it to work, and even followed a tutorial, but to no avail. The code I used is…

<link rel="stylesheet" type="text/css" media="screen" href="css/styles.css"/>

<xsl:comment>[if IE 6]&#62;
&#60;link rel="stylesheet" type="text/css" media="screen" href="http://www.yoursite.com/css/ie6.css" /&#62;
&#60;![endif]
</xsl:comment>

So this will need to go in your <head> tag. The top line of the code is your original and main sheet that will be used by good quality browsers. The following messy looking code is the sheet being placed in an XSL comment, and because of this escape characters are needed for the tags. This sheet will over ride the first one if the browser being used is IE 6. Also you will need to link to your sheet directly in the comment.

Hope it works for you too!

Post your comments here:

 
 

Comments

There are no comments for this entry yet.